Hi,
I have managed to uploaded pictures into a mysql db.
How does one go about displaying them from the mysql db back to a webpage (Using PHP)?
Thanks :evilgrin:
Use a fixed directory where you upload the images.
Store only the filename of the image in the mysql db
Get the row from the db.
Print the result: echo"<img src=\"http://www.yourwebsite.com/your_directory/$imgfile\" border=\"0\" alt=\"$imgfile\">"; where $fimgfile is the variable that contains the filename
Or echo out the field name from the database:
echo "<img src=\"{$row['image']}\">";
where the $row['image'] would be the field from the database from a mysql_fetch_array() operation like
$row=mysql_fetch_array($result,MYSQL_ASSOC);