I have successfully created a search box with a results page with the gracious help of some of you who frequent these forums..........now if you can gather your thoughts once again to feed me some coding ideas for pagination for these results, I would greatly appreciate it............also, I want to hightlight the background of every other row.......here is the code that is generating the results:
<?
$sql = "SELECT * FROM products WHERE name LIKE'%' '$searchString%' or maincat LIKE'%' '$searchString%' or subcat1 LIKE'%' '$searchString%' or keywords LIKE'%' '$searchString%'" ;
$result = @($sql, $dbconn);
if (!$sql) {
echo( "<P>Unable to execute query at this time.</P>" );
exit();
}
if (mysql_num_rows($result) == 0)
{
echo ("<table width=700 align=center border=0>");
echo ("<tr><td width=700 align=center><font face=verdana size=1 color=blue>We're sorry, but your search for <b>$searchString</b> did not return any results. Please try again.</td></tr>");
echo ("</table>");
}
else
{
while ($row = mysql_fetch_array($result))
{
$name = $row['name'];
$description = $row['description'];
$uniqueid = $row['uniqueid'];
$prodid = $row['prodid'];
echo ("<table width=600 align=center cellpadding=6 border=0>");
echo ("<tr><td width=25%><a href=productdetail.php?prodid=$prodid><font face=verdana size=1 color=blue>$name</font></a></td><td width=75% align=left><font face=verdana size=1 color=red>$description</font></td></tr>");
echo ("</table>");
}
}
?>
Thanks so much for your suggestions