can someone please look at my code below and tell me why it is only working half-way? It is only displaying radio buttons and seats for numbers 71, 73, 75, 77, 79, 81, 83, and 85.....and it is printing seat # 76 since that is the one in the database between seats 81 and 83....why is this happenening and HOW can i correct it???


$sql = "SELECT seat, alias FROM attendees"; $sql_result = mysql_query($sql,$connection) or die("Couldn't execute query.");

$row = mysql_fetch_array($sql_result);
$myseat = array('70','71','72','73','74','75','76','77','78','79','80','81','82','83','84');
$i = 70;


foreach ($myseat as $seat)
{
if (($seat) == ($row[0]))
{
if ($i <= 84)
{
?>
<td align="center" valign="top" class="red"><a class="sold" onMouseOver="self.status='SOLD TO <?php echo $alias; ?>'; return true;" onMouseOut="self.status=' '; return true;"><?php print $row[0]; ?></td>
<?php
}
}


else
{
if ($i <= 84)
{
?>
<td align="center" valign="top" class="green"><input type="radio" name="seat" value="<?php print $i++; ?>"><nobr /><font class="avail"><?php print $i++; ?></td>
<?php
}
}
}
?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to