Display all the images using loop from DB.this is my code. Image is saved to database as bite format. can't retrieve and display all the images using loop. for example img1,img2,img3 etc...Anyone know what i might be doing wrong?
$username = "root";
$password = "123";
$host = "localhost";
$database = "test";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$query = mysql_query("SELECT * FROM tbl_images");
while($row = mysql_fetch_array($query))
{
header('Content-type: image/jpg');
$content = $row['image'];
echo $content;
}