First off, I will try and describe what I want done..
I have multiple data entries (shows) that are all set at one, and I want them all selected, from a different table it gets data based off the shows ID, and lists them out.
However I am only able to get it to list out all the shows, but it only lists the data from the last show listed.. Not the two above it.
Heres my code.
I have multiple data entries (shows) that are all set at one, and I want them all selected, from a different table it gets data based off the shows ID, and lists them out.
However I am only able to get it to list out all the shows, but it only lists the data from the last show listed.. Not the two above it.
Heres my code.
PHP:
<?php
include ('connect.php');
$query = "SELECT showname, id, date FROM shows WHERE date = '1'";
$result = mysql_query($query)
or die ("No shows to run!");
while ($pet = mysql_fetch_object($result))
{
$showname = $pet->showname;
$date = $pet->date;
$id = $pet->id;
$sid = id;
echo "
<table border='1' cellpadding='3' width='400'>
<td colspan='6'>$showname</td>
<tr>
<td>ID $id</td>
<td>Entrant</td>
<td>Show Name</td>
<tr>";
$query = "SELECT petname, petid, showid, showname FROM `show` WHERE showid = '$id'";
}
$result = mysql_query($query)
or die ("No shows to run!");
while ($pet = mysql_fetch_object($result))
{
$petname = $pet->petname;
$petid = $pet->petid;
$showid = $pet->showid;
$showname = $pet->showname;
echo "
<td>$showid</td>
<td>$petname</td>
<td>$showname</td>
<tr>
";
}
?>
</tr></td></table><p>