View Single Post

  #3 (permalink)  
Old 12-08-2005
Jon
 
Posts: n/a
Default Re: Photo Gallery Display question

I ended up with a slightly different solution:

<table><tr>
<?php
$counter = 1;
while($row = mysql_fetch_array($resultGetPhotos)){
echo "<td>fileFromDB</td>";
if($counter % 5 == 0){
echo "</tr><tr>";
}
$counter++;
$i++;
}
?>
</tr></table>

Seems to work. Thank you for the help either way.
"Connector5" <junkmilenko@charter.net> wrote in message
news:_vYlf.2736$Xx3.1801@fe03.lga...
> echo "<table>\n";
>
> $picnum = 0;
> $maxpics = 25;
>
> while (($record = mysql_fetch_assoc($result)) && ($picnum < $maxpics))
> {
> if (($picnum / 5) == floor($picnum / 5))
> {
> echo "<tr>\n";
> }
>
> echo "<td>\n";
>
> // GENERATE THUMBNAIL HERE
>
> echo "</td>\n";
>
> if (($picnum / 5) == floor($picnum / 5))
> {
> echo "/<tr>\n";
> }
>
> $picnum += 1;
> }
>
> echo "</table>\n";
>
>
> "Jon" <jonra@netins.com> wrote in message
> news:dn9g8n$drg$1@news.netins.net...
>> All,
>>
>> I'm putting the final touches on a MySQL/PHP driven photo gallery I have
>> built, and am down to one last task. I need to be able to display

> thumbnails
>> from the gallery in rows of 5 on the main gallery page. I've found many
>> scripts out there that do this, but can't find one that works when the

> photo
>> data (fileName in this case) is coming from a MySQL DB where I need to

> loop
>> through values in a set of records. Does anyone have a script for doing
>> this? Or maybe can throw me the algorithm I'll need to use? Thank you in
>> advance.
>>
>>

>
>



Reply With Quote