<?php require_once('Connections/portepont.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$varFind_rsResults = "-1";
if (isset($_GET['search'])) {
$varFind_rsResults = $_GET['search'];
}
mysql_select_db($database_portepont, $portepont);
$query_rsResults = sprintf("SELECT * FROM pages WHERE `title` LIKE '%s' OR 'subtitle' LIKE '%s' OR 'content' LIKE '%s' OR 'quote' LIKE '%s' OR 'speaker' LIKE '%s' ORDER BY ID ASC", GetSQLValueString("%" . $varFind_rsResults . "%", "int"),GetSQLValueString("%" . $varFind_rsResults . "%", "int"),GetSQLValueString("%" . $varFind_rsResults . "%", "int"),GetSQLValueString("%" . $varFind_rsResults . "%", "int"),GetSQLValueString("%" . $varFind_rsResults . "%", "int"));
$rsResults = mysql_query($query_rsResults, $portepont) or die(mysql_error());
$row_rsResults = mysql_fetch_assoc($rsResults);
$totalRows_rsResults = mysql_num_rows($rsResults);
?>
|