Re: RE: Display picture from MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



See the >>>>>>>  below.
You can't send ANYTHING before header()
Miles

At 10:09 AM 7/7/2005, Bagus Nugroho wrote:
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]"; <<<<<<<<<< Comment this out and try it <<<<<<<<<<<<<<<<<<
    /*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



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux