Forums

PHP

This topic is locked

Displaying images from mysql

Posted 24 Nov 2005 01:28:11
1
has voted
24 Nov 2005 01:28:11 craig anderson posted:
Hi, ive developed a dynamic database site using dreamweaver 8 and php. I have uploaded a GIF image to mysql database and would like to display this as part of a recordset in dreamweaver. The image is stored as blog in mysql, however when attempting to view this through preview its just jumbled up text, so to speak. Could anyone advise how i go about doing this as there doesnt seem to be any format for displaying images. Thanks in advance.

Replies

Replied 24 Nov 2005 23:31:41
24 Nov 2005 23:31:41 Dave Thomas replied:
store it as a text link as the path to the image,

i.e '../img/mypic.gif'

and then refernece that in the recordset. except when inserting a dynamic image from a db, upon insert, choose the source from data bindings, then select the field that holds the path, this will then preview as an image.

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 25 Nov 2005 16:21:46
25 Nov 2005 16:21:46 craig anderson replied:
Its the latter that im trying to accomplish, displaying image from mysql database. Ive done what you said but no success, its just displaying ascii code. There doesnt appear to be any kind of encode option for images from the binding menu, just html etc. Any ideas?
Replied 25 Nov 2005 16:37:43
25 Nov 2005 16:37:43 Dave Thomas replied:
change it to a text field, not a blog.
and use the 'data sources' radio button, to access the recordset.

<img src="www.bluecoder.co.uk/dmx/dynamic_image_insert.jpg" border=0>

regards

Dave Thomas
<b>DMX Zone Manager</b>
Replied 25 Nov 2005 17:37:33
25 Nov 2005 17:37:33 craig anderson replied:
That kind of works in a way, however i have to set it as a hyperlink and it previews the image on a separate page, also i have to actually store the image somewhere. What im really after is after uploading the image to mysql database is be able to retrieve this, along with the rest of my recordset (which is all text and working fine) instead of the ascii text. It just doesnt seem to work on images.
Replied 25 Nov 2005 19:23:34
25 Nov 2005 19:23:34 craig anderson replied:
Got it, sorry took a while for penny to drop, thanks for your time and help mate. Appreciate it.

Reply to this topic