if (@$d == "m")
{
print "<table width='440' cellspacing='0' cellpadding='0' align='left' style='color: #897048'>";
print "<tr><td height='30' align='left' valign='middle'><strong><u>Episode Music</u></strong></td></tr>";
$sql = mysql_query("SELECT * FROM episodes_music WHERE tvshow = '$tvshow' AND episode_id = '$e' ORDER BY music_title");
print "<tr><td align='justify'>";
print "<table width='440' border='0' cellspacing='8' cellpadding='2'>";
while($body = mysql_fetch_array($sql))
{
$result = mysql_query("SELECT * FROM episodes_music WHERE episode_id = '$e'");
$numrecords = mysql_num_rows($result);
if ($numrecords == 0)
{
print "<tr><td>There is currently no known music for this episode, or none was used. If you know of music used in the episode, let us know by clicking <a href='contact.html'>HERE</a>.</td></tr>";
}
else {
extract($body);
print "<tr>";
print "<td>'$music_title'</td>";
print "<td align='left'><b>by</b></td>";
print "<td>$music_artist</td>";
print "</tr>";
}
}
print "</table>";
}
I can't see anything wrong, but it won't print the message when there are no records in the table.
Basically, what I need it to do is to print a message if there are no records matching a specific episode ID but if there are records, I need it to print these records.
So if I have episode id 919 with 8 records, I need it to print those 8 records. If I have episode id 912 with 0 records, I need it to print my message There is currently no known music for this episode, or none was used. If you know of music used in the episode, let us know by clicking <a href='contact.html'>HERE</a>.
Hopefully that will help!
Thanks in advance!
Edited by Mr. Matt, 01 December 2006 - 02:13 PM.
