How to display all images from MYSQL using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • selvasoft
    New Member
    • Mar 2010
    • 34

    How to display all images from MYSQL using PHP

    I want to display all images from my MYSQL database using PHP coding.The table having name,size,type, content fields. Please any one help me.

    Code:
    while($row=mysql_fetch_row($imgresult))
    {
    	header("Content-type: image/jpeg");
    	echo "$row[0]";
    }
    Am using above code to display one image from table. But i dont know to display more than one images on browser. Please any one help me.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    dont use this way,
    write your code this way

    Code:
    while($row=mysql_fetch_row($imgresult))
    {
        save_image_to_file($row[0],$filename);
        display_image_in_htmlway($filename);
    }

    Comment

    Working...