just did this quick and dirty, not really clean depending on number of results, but it works and should give you an idea on what you need to do
<?
$conn = mysql_connect('localhost', "xxxx", "xxxxxxx") or die("Could not connect to mysql");
$db = mysql_select_db("db") or die("Could not connect to database");
$query = "select * from table;";
$result = mysql_query($query) or die(mysql_error());
$i = 1;
?>
<table border="0" width="600">
<tr>
<?
while ($row = mysql_fetch_array($result))
{
if ($i < 4)
{
?>
<td width="33%"><img src="<? echo $row['fieldnameforpic']; ?>"></td>
<?
$i++;
}
else
{
?>
</tr>
<tr>
<td width="33%"><img src="<? echo $row['fieldnameforpic']; ?>"></td>
<?
$i = 2;
}
}
?>
</tr>
</table>