how to retreived images from the database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cheryl
    New Member
    • Nov 2006
    • 9

    how to retreived images from the database

    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!!!!!!!!! !
  • Nert
    New Member
    • Nov 2006
    • 64

    #2
    Originally posted by cheryl
    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($ge tImagePath) or die(mysql_error ());
    while($imgpath = mysql_fetch_arr ay($path)){
    echo "<img border='0' src='".$imgpath['imgpath']."' width='150'
    height='150' />"."<br />";
    }
    [/PHP]

    i hope my simple example would help you.


    --nert (^_^)

    Comment

    Working...