I have a script all finished, but now I have run into another problem with it. How do I change the code to reflect a search that returns NO results??
<pre>
<?
$search = $HTTP_POST_VARS['search'];
$show = $HTTP_POST_VARS['show'];
?>
<?php
$location = "localhost";
$username = "";
$password = "";
$database = "";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$color1 = "#ffffff";
$color2 = "#cccccc";
$row_count = 0;
$result=mysql_query("SELECT * FROM tours WHERE $show = '$search'") or die ("No results.");
$num = mysql_num_rows($result);
$cur = 1;
echo "<table border='0' cellspacing='0' cellpadding='0' width='750'><tr><td><table border='0' cellspacing='1' cellpadding='2' width='100%'><tr><td colspan='5' class='text'>The results of your search:<br><br></td></tr><tr><td class='text'><strong>Artist</strong></td><td class='text'><strong>Date</strong></td><td class='text'><strong>City/ State</strong></td><td class='text'><strong>Venue</strong></td></tr>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$artist = $row["toursArtist"];
$date = $row["toursDate"];
$city = $row["toursCity"];
$state = $row["toursState"];
$venue = $row["toursVenue"];
$row_color = ($row_count % 2) ? $color1 : $color2;
echo "<tr><td bgcolor=$row_color class='text'>$artist</td><td bgcolor=$row_color class='text'>$date</td><td bgcolor=$row_color class='text'>$city, $state</td><td bgcolor=$row_color class='text'>$venue</td></tr>";
$cur++;
$row_count++;
}
echo "</table></td></tr></table>";
mysql_close($conn);
?>
</pre>