From: sea dot iz at tiscali dot cz
Operating system: Win2000, Win2003
PHP version: 5.1.2
PHP Bug Type: MSSQL related
Bug description: No results with saving and retrieving images to and from
database
Description:
------------
I'm using following code for saving and retrieving images to and from
database (MS SQL 8.0). This works under PHP 5.0.2, but it stops to work
after upgrading to 5.1.2 and I must return to old version. Tested on
Win2000, WinXP and Win 2003 server.
Thanks for some help.
Reproduce code:
---------------
//my code:
//Saving images:
$datastring = file_get_contents($filenam);
$data = unpack("H*hex", $datastring);
$qry = "update TABLENAME set IMAGECOLUMN."=0x".$data['hex']."
where KEYCOLUMN=$id"; $ret = mssql_query($qry, $Link);
//Retrieving images:
$qry = "select IMAGECOLUMN from TABLENAME where KEYCOLUMN = $id";
$result = mssql_query($qry, $Link);
$row = mydb_fetch_array($result);
header("content-type: image/jpeg");
$nm = strtoupper($_REQUEST['IMAGECOLNAME']);
echo $row["$nm"];
Expected result:
----------------
With 5.0.2 everything works correctly, but with PHP 5.1.2 there is no
error report while saving and no image result while retrieving.
--
Edit bug report at http://bugs.php.net/?id=36301&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36301&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36301&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36301&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36301&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36301&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36301&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36301&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36301&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36301&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36301&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36301&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36301&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36301&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36301&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36301&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36301&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36301&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36301&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36301&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36301&r=mysqlcfg