Dynamo
2 replies to this thread. Most Recent
John Pye
27 May 2008, 1:05 pm
inserting a pic via PHP and MySql
Hi all Starting a new project and teaching myself php & mysql..
I have managed to connect to my database and can pass data from it to a web page. the problem I am having is that I can not get the saved image to appear ..
Can anyone help?
thanks
john
waltd
27 May 2008, 1:12 pmIf you have stored the image in your database as binary data, then
you will need a page that can pretend it is an image (send the right
content-type headers to be a GIF or JPEG or PNG) and pass an image
tag like <img src="get_image.php?id=12345" alt="<?=$image_alt?>" />
to it. That separate “image getter” file is critical — it’s not
possible to do this all in one PHP file.
If you have simply stored the pathname of the image in your database (more common technique) then you would simply print that out in your page using a Markup item.
Walter
On May 27, 2008, at 9:05 AM, John Pye wrote:
Hi all Starting a new project and teaching myself php & mysql..
I have managed to connect to my database and can pass data from it to a web page. the problem I am having is that I can not get the saved image to appear ..
Freeway user since 1997
John Pye
27 May 2008, 1:15 pmHi Walter,
I have done the latter, thanks I will give that a try!!
John