Page 1 of 1

Display image from database

Posted: Wed Dec 14, 2011 2:59 pm
by Josh7Harington
Hi there,

I need help with a gallery using the pagination tutorial on youtube.
Everything works great but instead of showing names like in the tutorial, i would like to show pictures from a database file (images.sql).

but my code for it keeps giving me broken errors from the <img src="" alt="" /> line.

if i want to show an image from the `image` column in the database `test`, what will the 'src="" ' or directory be ?

thanx,
Josh

Re: Display image from database

Posted: Wed Dec 14, 2011 3:57 pm
by Temor
are you inserting urls or full html code in the database?

easiest way would be to put the images on your server and insert the urls into your table and then retrieve them, put them in a variable and echo them out like this.
<img src="$img_url" />
also, show us what code you're having now and we might be able to help you fix it.