RE: Display picture from MySQL

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

 



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

 

[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