ID: 36961 Updated by: [EMAIL PROTECTED] Reported By: rnerovich at gmail dot com -Status: Open +Status: Assigned Bug Type: MSSQL related Operating System: Win2k PHP Version: 5.2CVS-2007-07-11 -Assigned To: +Assigned To: fmkAssig New Comment:
Assigned to the maintainer. Previous Comments: ------------------------------------------------------------------------ [2007-07-11 17:59:02] rnerovich at gmail dot com Tried the release at http://snaps.php.net/win32/php5.2-win32-latest.zip and got the following calling mssql_bind($sp,"@WAVEIMAGE",$waveinfo,SQLVARCHAR,FALSE,FALSE,$length); Error:E_WARNING mssql_bind()['a href='function.mssql-bind'>function.mssql-bind</a>]: Unable to set parameter at <xx.php> line xx ------------------------------------------------------------------------ [2007-07-09 13:29:03] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi ------------------------------------------------------------------------ [2006-04-03 22:23:41] rnerovich at gmail dot com Description: ------------ When inserting an image into MSSQL using SQLVARCHAR, this error is thrown with mssql_bind()... Warning: mssql_bind() [function.mssql-bind]: Unable to set parameter (not expected) If SQLTEXT is used the bind succeeds, but the execute fails with... Operand type clash: text is incompatible with image (expected) Reproduce code: --------------- // $filedata read in from drive, $filelen = lenth of data $sp = mssql_init('MSG_PROC_TEST',$dblink->dbresource); $mrecnum = '{1C296DF1-EE73-436E-BC55-09C58F53C132}'; $mfilename = '1075318802KUZMA.WAV'; mssql_bind($sp,"@MRECNUM", $mrecnum,SQLVARCHAR,FALSE,FALSE,38); mssql_bind($sp,"@MFILENAME",$mfilename, SQLVARCHAR,FALSE,FALSE,strlen($mfilename)); mssql_bind($sp,"@MID",&$mid,SQLVARCHAR,true,false,38); mssql_bind($sp,"@MWAVS",$filedata, SQLVARCHAR,false,false,$filelen); if(mssql_execute($sp)){ ... sp example CREATE PROCEDURE MSG_PROC_TEST @MRECNUM UNIQUEIDENTIFIER, @MFILENAME VARCHAR(50),@MID UNIQUEIDENTIFIER OUTPUT, @MWAVS IMAGE Expected result: ---------------- Insert file into image field in MSSQL successfully. Actual result: -------------- mssql_bind() or mssql_execute() fails because the data conversion to an image type doesn't work correctly. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36961&edit=1