ID: 43616 Updated by: [EMAIL PROTECTED] Reported By: ville dot tuomola at mehilainen dot fi -Status: Open +Status: Bogus Bug Type: MSSQL related Operating System: Fedora 8 PHP Version: 5.2.5 New Comment:
Thanks for the information. Previous Comments: ------------------------------------------------------------------------ [2008-02-15 12:35:14] sven dot vandorpe at telenet dot be Hi, Some additional information. This issue is resolved when using FreeTDS v0.82RC1 With kind regards, Van Dorpe Sven ------------------------------------------------------------------------ [2008-02-14 15:12:46] sven dot vandorpe at telenet dot be Some additional information about this problem. It seems that this is probably not PHP related. I tested the procedure on PHP 5.1.6 that was compiled with FreeTDS 0.63: The result was that the PHP script returned "2" Afterwards I compiled FreeTDS 0.64 and recompiled PHP 5.1.6 so that it used the FreeTDS 0.64 libraries: The result of the PHP script is now "0" The error in the Apache error log: "[Thu Feb 14 14:17:10 2008] [error] PHP Warning: mssql_execute() [<a href='function.mssql-execute'>function.mssql-execute</a>]: stored procedure has no return value. Nothing was returned into RETVAL in /usr/share/nagios/share/test.php on line 18" With kind regards, Van Dorpe Sven ------------------------------------------------------------------------ [2008-01-28 20:13:27] ethan dot nelson at ltd dot org Connecting to MSSQL 2000, I cannot get the return values from a user-defined function. The number of rows comes through. The column names comes through when I do fetch_array. However, the values do not. Same query returns values in query analyzer. Further, testing showed that when a SQL view was created that selected * from the user defined function and added a derived column, such as 'test' = 1, the derived column's value comes through, but still the other values associated with the user-defined function do not. ------------------------------------------------------------------------ [2007-12-17 13:24:43] ville dot tuomola at mehilainen dot fi Description: ------------ When executing a stored procedure with mssql_execute, it does not return the return value of the procedure. It does not matter whether the "skip_results" parameters is used in mssql_execute or not. Reproduce code: --------------- CREATE PROC sp_Test AS RETURN 2 <?php $myServer = "sqlserver"; $myUser = "dbuser"; $myPass = "pass"; $myDB = "db"; $s = mssql_connect($myServer, $myUser, $myPass) or die("Couldn't connect to SQL Server on $myServer"); mssql_select_db($myDB, $s) or die("Couldn't open database $myDB"); $proc = mssql_init("sp_Test", $s); mssql_bind($proc, "RETVAL", $ret, SQLINT2); //mssql_execute($proc); mssql_execute($proc, true); mssql_free_statement ($proc); mssql_close($s); echo "<h2>sp_Test returned: $ret</h2>"; ?> Expected result: ---------------- sp_Test returned: 2 Actual result: -------------- Warning: mssql_execute() [function.mssql-execute]: stored procedure has no return value. Nothing was returned into RETVAL in /var/www/vkajanvaraus/htdocs/test.php on line 20 sp_Test returned: 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43616&edit=1