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!
Replace 'filename' with the column name of where you stored the filenames. And this is assuming you have already connected to the database and queried it for the data.
You could optionally go the object oriented route and for that I recommend you read Harry Fuecks article here on Sitepoint (which is also part of his excellent book) - > http://www.sitepoint.com/article/php...gy-3-php-mysql
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:
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.
Bookmarks