PHP 4.0 Bug #9438: Error retrieving image field from MSSQL database
| From: | lbf at mail dot ru | Date: | Sun, 25 Feb 2001 01:27:09 +0000 |
| Subject: | PHP 4.0 Bug #9438: Error retrieving image field from MSSQL database | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47430@lists.php.net to get a copy of this message | ||
From: lbf@mail.ru
Operating system: Win2000 Prof SP1
PHP version: 4.0.4pl1
PHP Bug Type: MSSQL related
Bug description: Error retrieving image field from MSSQL database
When I try to retrieve image field from MSSQL7 database I get "PHP has encountered an Access
Violation at 77FCA9EA" and all PHP engine becomes unstable after this. The script is very
simple:
<?
include("msdb.php");
$id=$HTTP_GET_VARS["id"];
$rs=mssql_query("select Image from SpecBannerData where SpecBannerID=" . $id,$conn);
$arr=mssql_fetch_row($rs);
if ($arr)
{
header( "Content-type: image/jpg");
echo $arr[0];
}
?>
msdb.php:
<?
$conn=mssql_connect("127.0.0.1","sa","");
if (!$conn)
{
echo ("Can not connect to the database");
}
if (!mssql_select_db("metasearch",$conn))
{
echo ("Can not connect to the database");
}
?>
I'm quite new in PHP, but I met some other people report the same problems in PHP-related
forums. I used only precompiled PHP modules downloaded from php.net.
Best regards,
Leonid Freidin
--
Edit Bug report at: http://bugs.php.net/?id=9438&edit=1