Hello, I am trying to get 16 images to display in 4 columns, 4 rows.
I am wondering how I can get a new <tr> every 4 <td>'s.
Somewhat like this:
If more info is needed, ill try my best to provide it. I know I could just make 4 columns & rows in HTML, then echo the contents in each cell, but that's not my goal =).PHP Code:<?php
// connect to db
$SQL = "SELECT * FROM something WHERE field1 = '3' LIMIT 16"; /* maybe 20 rows in the table */
$results = mysql_query($SQL) or die("error");
while($n = mysql_fetch_array($results)) {
// then somehow i get a tr, 4 cells...then another tr & 4 more cells
// i would do this 4 times, for a total of 16
}
?>
Thanks





Bookmarks