Hi there im new to PHP, im trying to create a table based on a recordset using PHP

The table will be layed out like so

1 2 3
4 5 6
7 8 9
10 11 12

So it's a horizontal/vertical looper. Each number holds an image.

I have 12 images stored on a Databse with MySQL..

I can get 10 images to display, and then the rest of the images just dont show...

This is the Code

<?php 
$i=1; 
echo '<table width="180" border="0" cellspacing="5" cellpadding="0"> 
  <tr>'; 
do { ?> 
    <td align="center"><img src="<?php echo $row_Recordset1['ImgRoot']; ?>" width="60" height="60" /></td>
<?php 
    if($i%3==0) 
        echo '</tr> 
        <tr>'; 
    $i++; 
} while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> 
  </tr> 
</table>

Thank you for reading.
Dave

    I suppose there is a query somewhere which we might need to take a look at.

    Just to make sure that you do get alle the images, you could just run 'select * from TABLE' without any other conditions. Alsio, I would start with the while() statement for easier reading of code.

    while ($row_Recordset1 = mysql_fetch_assoc($Recordset1))
      {
      // output 
      }
    

    lastly: Please surround php code with

    [ /php] bb code tags
      Write a Reply...