I am wanting to shade the background of every other result in a list of search results to make it easier on the eyes. It was suggested that others have asked this question lately but I can't seem to find those posts. Can someone help me with this code?
Here is the code that is generating my results and it works fine, I just need to be able to shade every other result.
Thanks
<?
$sql = "SELECT * FROM products WHERE name LIKE'%' '$searchString%' or maincat LIKE'%' '$searchString%' or subcat1 LIKE'%' '$searchString%' or keywords LIKE'%' '$searchString%'" ;
#WHERE name 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>");
}
}
?>