Thursday, 22 August 2013

show specific file from the directory in php

show specific file from the directory in php

How can I show a specific file from the directory which name is known to
me? I have this code to show all files present in that directory:
$result = mysql_query("SELECT * FROM photos");
while($row = mysql_fetch_array($result))
{
echo '<div id="imagelist">';
echo '<p><img src="'.$row['location'].'"></p>';
echo '<p id="name">'.$row['caption'].' </p>';
echo '</div>';
}
Photos table has 3 columns id, location, caption.

No comments:

Post a Comment