hi guys,
ok this is my code below, it works
<html>
<head> </head>
<body>
<?php
$categoryID=$_POST['categoryID'];
$color[0] = "blue";
$color[1] = "yellow";
mysql_connect("localhost","phpuser","phpuser03") or die ("Database connection error");
mysql_select_db('booking');
$sql = "SELECT * FROM event WHERE categoryID='$categoryID'";
$result = mysql_query($sql);
#while ($row = mysql_fetch_array($result)) {
#echo $row['EventName'] . ',' . $row['Date'] . ',' . $row['Venue'] . "<br>\n";
echo "<table>\n";
echo " <tr>\n";
echo " <th><b>Event Name</b></th>\n";
echo " <th><b>Date</b></th>\n";
echo " <th><b>Venue</b></th>\n";
echo " <th><b>Town</b></th>\n";
echo " <th><b>Availabilty</b></th>\n";
echo " </tr>\n";
while ($row = mysql_fetch_array($result)) {
$a = ($a+1)%2;
echo '<tr bgcolor='.$color[$a] . ">\n";
#echo ' <td>'.$row['EventName'].'</td>'."\n";
echo '<td><a href="availabletickets.php">' . $row['EventName'] . "</a></td>\n";
echo ' <td>'.$row['Date'].'</td>'."\n";
echo ' <td>'.$row['Venue'].'</td>'."\n";
echo ' <td>'.$row['Town'].'</td>'."\n";
echo ' </tr>'."\n";
}
echo '</table>';
?>
</body>
</html>
but where do i insert the code below, i realise i have to tidy it up but if i cant slot it in ot the right place then that will be a start for me
<?
$sql = "select total_seats, booked_seats from seats where performance = 'this_one'";
$...do the query and get the results into $row[] etc...
if($row['total_seats']==$row['booked_seats'])
{
echo "<img src=\"fully_booked.jpg\" alt=\"This show is fully booked\" width=\"20\" height=\"20\">\n";
}