generating tables
Posted: Wed Dec 31, 2003 6:18 pm
I'm trying to write a table: one row of images with a row beneath containing a checkbox with the same value as the image above and repeat this for every image in the query.
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 %
{ echo "</tr><tr>"; }
}
?>
</table>
</form>
<?php mysql_close( $link ); ?>
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 ); ?>