Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

not able to display multiple images from mysql database

multiple images from mysql database

10:55 am on Apr 2, 2009 (gmt 0)

New User

5+ Year Member

joined:Feb 28, 2009
posts: 24
votes: 0

hi world,

I'm not able to display multiple images from blob.Why the problem occurs.I can able to display one image. by this code.Any solutions would be gr8.Here is my code.Please help

include "includes/dbconnection.php";

$result = mysql_query("select image from tbl_images");
while($result_data = mysql_fetch_array($result))
header("Content-type: image/jpg") ;
header("Content-type: image/gif") ;



11:06 am on Apr 2, 2009 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 6, 2005
votes: 0

You appear to be sending the correct content-type headers for the image, then outputting it. However, you are including text content (the <br>), which should not be there.

If you want to list numerous images you need to write two scripts: one to loop through your images and create the HTML (<img> tags) and another that when called from an <img> tag will generate an image (like the first part of your script).