I'm not even close, but I've wrestled with it long enough and need some help. Here's what I have so far:
<table border=1>
<tr>
<?php
$count = 0;
while ($r = mysql_fetch_array($result)) {
$count++;
echo "\n<td><img src=\"/images/thumbnails/".$r['imagepath']."\"></td>";
if (($count % 4) == 0 ) { echo "</tr><tr>"; }
while ($r = mysql_fetch_array($result))
{$count++;
echo "\n<td><input name=\"images[]\" type=\"checkbox\" value=\"$r[imagepath]\"></td>"; }
if ($count %
}
?>
</table>
</form>
<?php mysql_close( $link ); ?>