RE: Display picture from MySQL
| From: | Bagus Nugroho | Date: | Thu, 07 Jul 2005 13:09:38 +0000 |
| Subject: | RE: Display picture from MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-218291@lists.php.net to get a copy of this message | ||
Hi,
Firstly, thanks for your advise.
But, it doesn't work if combine with text or if we need display more than one record.
Here's my code :
<?php
mysql_connect("localhost","root","password") or Die ("Failed
to connect");
mysql_select_db("intdata") or Die ("Failed to select databse");
$res=mysql_query("SELECT * FROM main") or die("error again");
while ($line = mysql_fetch_array($res)){
echo "Lot Info : $line[lotID]";
/*Send headers*/
header("content-type: image/gif");
echo $line[picture];
echo "\n";
}
?>
It was displayed several record from $line[lotID], the followed information like this :
Cannot modify header information - headers already sent by
and a picture if opened with notepad.
What's wrong
Agian, thanks in advance