The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Using image filesnames once they are retreived from mySql

Ok, so I've stored some image filenames in mysql... my query grabs them, brings them in, now I cant figure out how to assign the filename toa variable, so i can use it as an image source...
I'm using PHP...
Thanks in advance!

Thanks!

Glad I could help, just remember that this was just a simple example, be sure you know the path to the image files from the page you are using this code. For instance if you have an images folder and the page is in your root directory it would be something like such:

$img = '<img src="images/' . $image['filename'] . '" />';

And if the page were in a subdirectory you would have something like:

$img = '<img src="../images' . $image['filename'] . '" />';

Of course you could always do absolute paths but I tend to shy away from them when I can. And then there is mod_rewrite in Apache but that is a whole other story.