view all images in one page
Posted: Sat Mar 15, 2008 10:41 am
Hi,
I need help in this code ,,,
I have table named subject ,in this table i have four fields
(id int(9) auto_increment PK, ImageTitle varchar(30), ImageSubject TEXT and Image mediumblob)
I want display all fields in one webpage to show me the Title ,Subject and the image!
In this code i can't run the webpage with the image! it's running without Image when i remove //echo $result2['Image'];
Thank you
I need help in this code ,,,
I have table named subject ,in this table i have four fields
(id int(9) auto_increment PK, ImageTitle varchar(30), ImageSubject TEXT and Image mediumblob)
I want display all fields in one webpage to show me the Title ,Subject and the image!
In this code i can't run the webpage with the image! it's running without Image when i remove //echo $result2['Image'];
Thank you
Code: Select all
//view all subjects with the images.
<?php
include ("condb.php");
$query="select * from subject ";
$result=@mysql_query($query,$con);
$result = mysql_query($query) or die('Error, query failed');
while ($result2 = mysql_fetch_array($result))
{
echo $result2['ImageTitle'];
echo"<br/>" ;
echo $result2['ImageSubject'];
echo"<br/>"
header("Content-type: image/jpeg");
echo $result2['Image'];
echo"<hr/>" ;
}
mysql_close();
?>