I’ve been trying to put together a script which allows a user to select, upload and then retrieve a image file from a mySQL database.
I found the following example which I’ve managed to implement so that I can upload and delete BLOB files. Hownever, even though the narrative at the beginning of the page explains that the script allows for the retrieval of the file, I’ve been looking at this for days and I just can’t find it, which is very possibly down to my inexperience.
I just wondered whether someone could perhaps please highlight the retrieval piece of code so that I can continue to my script together.
A simple barebones version:
SELECT blobfield AS image FROM yourtable$result = mysql_query("SELECT ...") or die(mysql_error())$row = mysql_fetch_asssoc($result)header('Content-type: image/jpeg'); echo $row['blobfield']