I'm assuming that you have already uploded the images and their names into the database (MySql). If so, try this, works fine with me:
<?php
$the_path="../../path/to/images";
$table="tablename";
// connecting to the database
if (!($link=mysql_pconnect($DB_SERVER,$DB_LOGIN,$DB_PASSWORD)))
{
DisplayErrMsg(sprintf("internal error %d:%s\n",mysql_errno(),mysql_error()));
exit();
}
//getting the data
if (!(@$result=mysql_db_query("$DB","select * from $table order by imgid")))
{
DisplayErrMsg(sprintf("internal error %d:%s\n",mysql_errno(),mysql_error()));
exit();
}
while(($row=mysql_fetch_array($result)))
{
$v=$row["imgid"];
$name= $row["imgname"];
$filename="$the_path/$name";
//Displaying the image...
echo "<img src=$filename><br>";
}
?>
// End of script.
Of course, you can output the image in a neat way by using tables and other styles...
Hope this help.