Ok I'm working on a gallery script and I need some help. I have a bit of code that shows thumbnails of images from users in the database.
Here's the code:
echo "<TABLE class=tborder cellSpacing=1 cellPadding=6 width=100% align=center border=0>";
echo "<TBODY>";
echo "<TBODY id=collapseobj_forumbit_12>";
$limit = 12;
$query_count = "SELECT * FROM pictures2 WHERE approved='1' ORDER BY id desc";
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
$PHP_SELF = $_SERVER['PHP_SELF'];
if(empty($page)) {
$page = 1;
}
$limitvalue = $page * $limit - ($limit);
$query = "SELECT * FROM users,pictures2 WHERE approved='1' ORDER BY id desc LIMIT $limitvalue, $limit";
$result = mysql_query($query) or die("Error: " . mysql_error());
while($row = mysql_fetch_array($result)) {
echo "<TR>";
echo "<TD class=alt1 align=left width=15%>";
echo "<a href=profile.php?username=".$row['username']."><img src=/pictures/thumb/thumb-".$row['filename']." border=0></a>";
echo "</TD>";
echo "<TD class=alt2 align=left width=15%>";
echo $row['description'];
echo "</TD>";
echo "</TR>";
}
echo "</table>";
//------pages links below---//
However, I want it to show 3 rows of 4 images on each page. Right now, it only shows one row of 3 images on each page. How can I make it break up all the images from the database and make it show 3 rows or 4 images on each page? I already have the page script, so if it shows a total of 12 images per page but I don't know how to make it show those 12 images seperated into 3 rows.
Thanks in advance for any help.