Ok heres another problem of mine. I am trying to display a 5column 20 row table with values from a database.
The database values are as follows:
ID 1 has value 1
ID 2 has value 2
ID 3 has value 3 and so on to 100
I want the table to look like this:
| 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 |
etc to
| 96 | 97 | 98 | 99 | 100 |
The values in the table however must come from the database as there are other attributes attached to them.
Here is the code I have tried, but it gives me a table 100x100, and the values are as follows
| 1 | 1 | 1 | 1 | 1 | to 100
| 2 | 2 | 2 | 2 | 2 | etc etc
<?php
do {
?>
<table>
<?php
for ($j=0; $j<=20; $j++)
{
$html .= "<tr>";
for ($i=0; $i<=5; $i++)
{
?>
<td width='15'><img src="../Images/circle1.gif" name="<?php echo $row_rstAvailSeats['seat_number'];?>"></td>
<td width='15'><div align="right"><?php echo $row_rstAvailSeats['seat_number']?></div></td>
<td width='20'><?php echo $row_rstAvailSeats['row_num']; ?></td>
<td width='20'><?php echo $row_rstAvailSeats['block_id']; ?></td>
<?php
}
$html .= "</tr>";
}
?>
</table>
<?php
} while ($row_rstAvailSeats = mysql_fetch_assoc($rstAvailSeats));
$rows = mysql_num_rows($rstAvailSeats);
if($rows > 0) {
mysql_data_seek($rstAvailSeats, 0);
$row_rstAvailSeats = mysql_fetch_assoc($rstAvailSeats);
}
?>
Any ideas what I could do??
Regards