my .png files r stored as a blob in MySql,
I wanna to display them out in php through a web browser.
this is part of code (in php):
---after connect to database , [code=php]
$dbQuery=" select name, png1, png2 from png";
$result=mysql_q uery($dbQuery) or die("Could not get file list");
// to display
while($row=mysq l_fetch_array($ result))
{
?>
<tr>
..............
<td><?php echo $row["phg1"]; ?></td>
...........
</tr>
}[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
sure,,, it does not work, and I tried this way :
firstly , download .png files out from mysql to a local directory,
then display it using :
------------------------------------------------------
[code=php]
$imagepath="/home/......1.png";
$image=imagecre atefromjpeg($im agepath);
header('Content-Type: image/png');
imagejpeg($imag e); [/code]
-------------------------------------------------------
this does not work either.
anyone has good ideas about it ? please help . Thanks a million.
Tanya
I wanna to display them out in php through a web browser.
this is part of code (in php):
---after connect to database , [code=php]
$dbQuery=" select name, png1, png2 from png";
$result=mysql_q uery($dbQuery) or die("Could not get file list");
// to display
while($row=mysq l_fetch_array($ result))
{
?>
<tr>
..............
<td><?php echo $row["phg1"]; ?></td>
...........
</tr>
}[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
sure,,, it does not work, and I tried this way :
firstly , download .png files out from mysql to a local directory,
then display it using :
------------------------------------------------------
[code=php]
$imagepath="/home/......1.png";
$image=imagecre atefromjpeg($im agepath);
header('Content-Type: image/png');
imagejpeg($imag e); [/code]
-------------------------------------------------------
this does not work either.
anyone has good ideas about it ? please help . Thanks a million.
Tanya
Comment