<?php
print "<table><tr>";
$column = 1;
for ($i = 1; $i <= $rowcount; $i++) {
if ($column == 3) {
$column = 1;
print "</tr><tr>";
}
else {
$column++
}
print "<td>" . $row[$i]["IMAGE"] . "</td>";
}
print "</tr></table>";
?>
That isn't very clean but it shows the basic principal. Walk through all of the rows you've returned from the database, and use a separate variable to count the number of columns that you've displayed so far.