I am still having trouble. I keep receiving the following error. "Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource"
Below is the php code.
$query1 = "SELECT id, company, address, city, state, zip, email, website, map, cuisine1, cuisine2, type, phone FROM restaurants ";
if($cuisine != "Display All")
{
$wherecuisine = "(cuisine1 LIKE '$cuisine%' OR cuisine2 LIKE '$cuisine%' OR type LIKE '$cuisine%') ";
}
if($location != "Display All")
{
$wherelocation = "(location LIKE '$location%' OR city LIKE '$location%') ";
}
if($wherecuisine || $wherelocation)
$query1 .= "where ";
if($wherecuisine)
$query1 .= $wherecuisine;
if($wherecuisine && $wherelocation)
$query1 .= "and ".$wherelocation;
if(!$wherecuisine && $wherelocation)
$query1 .= $wherelocation;
$query_results = mysql_db_query("database","$query1");
echo "<table width=100% border=0 cellspacing=0 cellpadding=3>\n";
echo "<tr>\n";
while($row = mysql_fetch_object($query_results))
{
printf("<td class=reg><span class=busname><A HREF=\"details.php?id=$row->id\">$row->company</A></span> -- (%s%s)</td></tr><tr><td class=reg>%s %s, %s %s %s</td></tr><tr><td class=listing><a href=\"$row->map\" target=\"_blank\">Map</a> | <a href=\"mailto:$row->email\">Email</A> | <a href=\"http://$row->website\" target=\"_blank\">Website</A></td></tr><tr><td><hr></td></tr>\n",
$row->cuisine1, $row->cuisine2, $row->address, $row->city, $row->state, $row->zip, $row->phone);
}
echo "</table>\n";