Im trying to display the results from a search (variable named: $search)
The results come out fine but the "previous and next" links do not. Right now I have it set to just show 2 results per page just for testing purposed. If you could look at my code and see what im doing wrong that would be great.
Thanks
Code:
PHP Code:
<?php
// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
if ($search) {
$result = mysql_query(
"SELECT * FROM _adult WHERE notactive='$notactive' order by date desc limit $rowstart,2"); //Select Database
$result2 = mysql_query("select * from _adult");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<br><br>";
$limit1 = $_GET['rowstart'] - 2;
echo '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.$limit1.'">< Previouse Page</a>';
}
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
$limit = $_GET['rowstart'] + 2;
echo '<a href="'.$_SERVER['PHP_SELF'].'?rowstart='.$limit.'">Next Page ></a>';
}}
?>
Bookmarks