Ok that makes sense. I'm a bit slow on this and I've drank a stupid amount of coffee so I'm having trouble thinking this through. Do you mean something like:
echo "<TABLE WIDTH='740' BORDER=\"0\">\n";
for($i = 0; $i < $num_rows; $i++) {
$row = mysql_fetch_array($result);
if($i % $columns == 0) {
echo "<TR>\n";
}
echo "<div>";
echo "<tr><TD align='center' bgcolor='#3366FF'><font face='Arial, Helvetica, sans-serif' color='#FFFFFF'>" . $row['image_title'] . "</font></TD></tr>";
echo "<tr><TD align='center' bgcolor='#33CCFF'><font face='Arial, Helvetica, sans-serif' color='#FFFFFF'>" . $row['image_id'] . "</font></TD></tr>";
echo "<tr><TD align='center' bgcolor='#3366FF'><font face='Arial, Helvetica, sans-serif' color='#FFFFFF'>" . $row['log_name'] . "</font></TD>";
echo "</div>";
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows) {
echo "</TR>\n";
}
}
echo "</TABLE>\n";
This is returning all the results one on top of eachother rather than in the 3 columns. Sorry if I'm a bit slow, I'm pretty new to this still.