I am working on image uploader in which the user uploads the image to the mysql database via a simple HTML/PHP form.
It works, and now I want to retrieve the saved images from MySQL in a HTML table format. But I am not successful. I am very much a novice in PHP. I have attached the currently used code... can someone please help me create a solution which displays the result as pretty looking table?
I also want to allow the user to upload multiple files/images at a time and store those in the database. How would that be possible?
Here is my code:
$query = "SELECT * FROM ae_gallery";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
echo "<center><b><h1><u>WV Images</u></h1></b></center><br>";
echo "E_Name – Job_Num – Reason – Time –Image<br><hr>";
while(list($E_Name,$Job_num,$ext,$image_time,$data,$Remarks,)=mysql_fetch_array($result))
{
echo "
{$E_Name}
–
{$Job_num}
–
{$Model}
–
{$Reason}
–
{$image_time}
–
<a href='download.php?id={$id}'><img src='http://pagename/wv-images /download.php?id={$id}' width='80' height='80' alt='{$title}' border='0'></a>
<br><hr>" ;
}
}
?>
</body>
</html>