getting an image from a database
| From: | David Elliott | Date: | Tue, 30 Jul 2002 20:06:37 +0000 |
| Subject: | getting an image from a database | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-15028@lists.php.net to get a copy of this message | ||
hi all
A small bit of php code below will pull an image from a database. My problem
is if the image is large (300 x 200) then it does not get displayed in IE.
smaller images do. It also works properly in Opera, and nutscrape for all
sizes. Any thoughts ?
==========8<=============================================================
@mssql_connect(Server,User,PWord) or die ("Could not connect");
$ExcQry="
select
structurepng
from
dbo.Product
where
ItemId = $SItemId";
$result = @mssql_query($ExcQry) or die ("The Query <hr><pre>".$ExcQry.
"</pre><hr>"."Gave this
error<hr><br>".mssql_get_last_message ());
list($structurepng)=mssql_fetch_row($result);
header("content-type: image/x-png");
print $structurepng ;
flush() ;
==========8<=============================================================
--
BFN, _______________________________________________
David | David Elliott | Software Engineer |
_________________________| list@elliott.uk.com | PGP Key ID 0x650F4534 |
| Life is a dead-end street. |