how to display images using php + mysql.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ecxzqute
Forum Commoner
Posts: 29
Joined: Tue Oct 14, 2008 12:26 am

how to display images using php + mysql.

Post by ecxzqute »

i am developing a small project, i have managed the uploads. now my pain in the neck is to display the images.. i didn't save the images in my db whereas i have put them in a single folder called 'images' and what i have stored in my db is the just the file name.. now i want to display them.. how am i gonna do this?..

any help plz?
samsolomonraj
Forum Newbie
Posts: 12
Joined: Mon Feb 09, 2009 3:34 am
Location: India, Chennai

Re: how to display images using php + mysql.

Post by samsolomonraj »

You need to store the image name with the extension like .jpg, .png. .gif, etc... in the db.
By using the HTML img tag you can display the images..

<img src="image_path/<?php echo $image_name ?>

Your's,
Sam..
ecxzqute
Forum Commoner
Posts: 29
Joined: Tue Oct 14, 2008 12:26 am

Re: how to display images using php + mysql.

Post by ecxzqute »

how about if there are more than one image to show?
samsolomonraj
Forum Newbie
Posts: 12
Joined: Mon Feb 09, 2009 3:34 am
Location: India, Chennai

Re: how to display images using php + mysql.

Post by samsolomonraj »

Using foreach concept for displaying multiple images..
Post Reply