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=29408&edit=1