This is my code for my results page.... I am having problems building the next and previouse page buttons to show my search results... My error comes up in the Limit area somewhere....
If anyone knows the code that would help me out alot thanks
<?php require_once('Connections/canada_search.php'); ?>
<?php
if (!$category || !$term)
{
echo "You have not entered search details. Please go back and try again.";
exit;
}
$category = addslashes($category);
$term = addslashes($term);
$maxRows_search = 10;
$pageNum_search = 0;
if (isset($HTTP_GET_VARS['pageNum_search'])) {
$pageNum_search = $HTTP_GET_VARS['pageNum_search'];
}
$startRow_search = $pageNum_search * $maxRows_search;
mysql_select_db($database_canada_search, $canada_search);
$query_search = "select * from search where ".$category." like '%".$term."%'";
$query_limit_search = sprintf("%s LIMIT %d, %d", $query_search, $startRow_search, $maxRows_search);
$search = mysql_query($query_limit_search, $canada_search) or die(mysql_error());
$row_search = mysql_fetch_assoc($search);
if (isset($HTTP_GET_VARS['totalRows_search'])) {
$totalRows_search = $HTTP_GET_VARS['totalRows_search'];
} else {
$all_search = mysql_query($query_search);
$totalRows_search = mysql_num_rows($all_search);
}
$totalPages_search = ceil($totalRows_search/$maxRows_search)-1;
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<br>
<?php do { ?>
<table width="785" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="158"><font size="2">Church Name/Pastor</font></td>
<td width="203"><font size="2">Address</font></td>
<td width="192"><font size="2">Contact</font></td>
<td width="232"><font size="2">URL</font><font size="2"> </font><font size="2"> </font></td>
</tr>
<tr align="left" valign="top">
<td><font size="2"><?php echo $row_search['churchname']; ?></font></td>
<td><font size="2"><?php echo $row_search['address']; ?> <br>
<?php echo $row_search['city']; ?> <br>
<?php echo $row_search['region']; ?> <br>
<?php echo $row_search['postalcode']; ?> <br>
<?php echo $row_search['country']; ?> </font></td>
<td><font size="2">Phone1:<?php echo $row_search['phone1']; ?><br>
Phone2:<?php echo $row_search['phone2']; ?><br>
Fax:<?php echo $row_search['fax']; ?><br>
Email:<?php echo $row_search['email']; ?> </font></td>
<td><?php echo $row_search['URL']; ?><br>
<?php $HTTP_GET_VARS['URL']; ?> </td>
</tr>
</table>
<br>
<?php } while ($row_search = mysql_fetch_assoc($search)); ?>
</body>
</html>
<?php
mysql_free_result($search);
?>