By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,719 Members | 1,439 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,719 IT Pros & Developers. It's quick & easy.

how to retreived images from the database

P: 9
Hello programmers... I have save the pathname of the uploaded photos in the database. The pathname is on the database but I dont know how to retrieved it from the database so that the uploaded photos can be able to see in my website.....

help please!!!!!!!!!!
Feb 3 '07 #1
Share this Question
Share on Google+
1 Reply


Nert
P: 64
Hello programmers... I have save the pathname of the uploaded photos in the database. The pathname is on the database but I dont know how to retrieved it from the database so that the uploaded photos can be able to see in my website.....

help please!!!!!!!!!!
hi Cheryl..,

uhmmn i think your not actually retrieving images from the database just the path of the image right? Well if you have the exact path of these images uploaded.., you can use the <img> tag to make these images visible on our page. For example:

let say you have the table tbl_images containing the column for imgpath. all you have to do is to create a simple query like this.
[PHP]
$getImagePath = "SELECT * FROM tbl_images";
$path = mysql_query($getImagePath) or die(mysql_error());
while($imgpath = mysql_fetch_array($path)){
echo "<img border='0' src='".$imgpath['imgpath']."' width='150'
height='150' />"."<br />";
}
[/PHP]

i hope my simple example would help you.


--nert (^_^)
Feb 3 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.