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=29408&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29408&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29408&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29408&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29408&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29408&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29408&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29408&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29408&r=support Expected behavior: http://bugs.php.net/fix.php?id=29408&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29408&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29408&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29408&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29408&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29408&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29408&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29408&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29408&r=float