Here is a sample of the code as it is now:
$result = mysql_query("SELECT showname, role, network FROM tbltv where id = $_GET[clientID]");
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
// Display the title of category
echo("<tr bgcolor='#666666'>");
echo("<td colspan='3'><font color='#FFFFFF'><b>TELEVISION</b></font></td></tr>");
// set column vars
$cols = array('#CCCCCC','#999999');
$i = 0;
// generate table row
while ( $row = mysql_fetch_array($result) ) {
echo("<tr bgcolor=" . $cols[$i++%2] . "><td>" . $row["showname"] . "</td><td>" . $row["role"] . "</td><td>" . $row["network"] . "</td></tr>");
}
You can see that the "Category Title" (in this case TELEVISION) is printed before the array is fetched. This was done to avoid displaying the Title above every row. However, if the client does not have any entries in this category, it (obviously) prints the title anyway and then moves on to the next category.
What statement would say " if $result returned no value move on" ??
Thanks for your help.
Wendall Williams
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php