#29408 [Opn-Bgs]: Binding certain types of variables clears all bindings
ID: 29408 User updated by: mynameisfiber at gmail dot com Reported By: mynameisfiber at gmail dot com -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: linux 2.6.5-gentoo-r1 PHP Version: 4.3.7 New Comment: thanks alot! that fixed everything right up proving it wasn't infact a bug. i'm putting a note in the mssql_bind page to clear this up for others. thanks again :-) Previous Comments: [2004-07-27 16:14:20] patrick dot schutte at gmx dot de Hi, try mssql_bind($query, @orgId, $org, SQLINT2,FALSE,FALSE); mssql_bind($query, @loginName, $user, SQLVARCHAR,FALSE,FALSE,n); n=len of varchar in stroed Procedure Works fine with PHP5/freetds0.62.3/MSSQL2000/tdsversion=7.0 [2004-07-27 15:57:47] mynameisfiber at gmail dot com Description: i am trying to do mssql (through freetds 0.62.3) with stored proc's however if i try sending in a parameter of SQLVARCHAR, SQLCHAR, SQLTEXT, none of the parameters go through... in the following example, i get an error if @loginName is sent as a SQLVARCHAR (and uppon sniffing the actual request i see that NO parameters are sent in this case) however if i change it to SQLINT2 everything works fine (except @loginName goes in as '0' which isn't productive). the only possible thing i can think of to explain this is that the message is too long and becomes truncated? or maybe this version of PHP hasn't updated it's mssql connection module? does anyone have any ideas or even any solutions? thanks alot! :-) Reproduce code: --- (after connecting to the database) $query = mssql_init('adSetUserByLogin', $dbcnx); $org = 360; $user = a; mssql_bind($query, @orgId, $org, SQLINT2); mssql_bind($query, @loginName, $user, SQLVARCHAR); $res = mssql_execute($query); Expected result: i would have expected the stored procedure to go on just fine so that it's output could be later retrieved Actual result: -- Warning: mssql_execute(): message: Procedure 'adSetUserByLogin' expects parameter '@orgId', which was not supplied. (severity 16) in /var/www/localhost/htdocs/aosr/test.php on line 24 Warning: mssql_execute(): stored procedure execution failed in /var/www/localhost/htdocs/aosr/test.php on line 24 Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in /var/www/localhost/htdocs/aosr/test.php on line 27 -- Edit this bug report at http://bugs.php.net/?id=29408edit=1
#29408 [NEW]: Binding certain types of variables clears all bindings
From: mynameisfiber at gmail dot com Operating system: linux 2.6.5-gentoo-r1 PHP version: 4.3.7 PHP Bug Type: MSSQL related Bug description: Binding certain types of variables clears all bindings Description: i am trying to do mssql (through freetds 0.62.3) with stored proc's however if i try sending in a parameter of SQLVARCHAR, SQLCHAR, SQLTEXT, none of the parameters go through... in the following example, i get an error if @loginName is sent as a SQLVARCHAR (and uppon sniffing the actual request i see that NO parameters are sent in this case) however if i change it to SQLINT2 everything works fine (except @loginName goes in as '0' which isn't productive). the only possible thing i can think of to explain this is that the message is too long and becomes truncated? or maybe this version of PHP hasn't updated it's mssql connection module? does anyone have any ideas or even any solutions? thanks alot! :-) Reproduce code: --- (after connecting to the database) $query = mssql_init('adSetUserByLogin', $dbcnx); $org = 360; $user = a; mssql_bind($query, @orgId, $org, SQLINT2); mssql_bind($query, @loginName, $user, SQLVARCHAR); $res = mssql_execute($query); Expected result: i would have expected the stored procedure to go on just fine so that it's output could be later retrieved Actual result: -- Warning: mssql_execute(): message: Procedure 'adSetUserByLogin' expects parameter '@orgId', which was not supplied. (severity 16) in /var/www/localhost/htdocs/aosr/test.php on line 24 Warning: mssql_execute(): stored procedure execution failed in /var/www/localhost/htdocs/aosr/test.php on line 24 Warning: mssql_fetch_array(): supplied argument is not a valid MS SQL-result resource in /var/www/localhost/htdocs/aosr/test.php on line 27 -- Edit bug report at http://bugs.php.net/?id=29408edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29408r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29408r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29408r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29408r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29408r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29408r=needscript Try newer version: http://bugs.php.net/fix.php?id=29408r=oldversion Not developer issue:http://bugs.php.net/fix.php?id=29408r=support Expected behavior: http://bugs.php.net/fix.php?id=29408r=notwrong Not enough info:http://bugs.php.net/fix.php?id=29408r=notenoughinfo Submitted twice:http://bugs.php.net/fix.php?id=29408r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29408r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29408r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29408r=dst IIS Stability: http://bugs.php.net/fix.php?id=29408r=isapi Install GNU Sed:http://bugs.php.net/fix.php?id=29408r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29408r=float