Q:

Generating photo album using php and mysql

i have a mysql database storing uploaded photos , i am trying to generate a photo album using php , assuming i have 20 photos i need to put every 5 images in one row then start a new row with the 6th image .
i succesfully did it but i also need to attach the image id from the mysql database to the image displayed in the album so when i click the image the image id should be forwarded along with the url so i can allow users to comment to the picture and store the comments in database along wih the image id , how can i do it please ? 

A:

u need 2 scripts: to send list of images and to send the image data

i need to put every 5 images in one row then start a new row with the 6th image

u can use something like 
for($i=0;$i<count($images);$i++)
  {
     echo '<img src="/myLinkTogetImagedata?id='.$i.'"/>';
     if($i%5==0)echo '<br/>';
  }

to send image data u need to send mime type in header
http://php.net/manual/en/function.header.php
and data from DB

think you can save image path in db

yeh, saving filename match better then saving image data in DB

