|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-06 10:46 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 21:00:01 2025 UTC |
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.