|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-03 05:32 UTC] kalle@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 05:00:02 2025 UTC |
Description: ------------ Hello, I connect to a MSSQL server and run a stored procedure, but I can't read out the result of the query in that sp. I use the mssql_init,mssql_bind,mssql_execute functions like I saw on PHP.net, but it does not work. The stored procedure runs correctly, without any error, and it should return values, becouse I tested it in SQL Server Man. Studio whit the same parameters. Reproduce code: --------------- include("dbconn.php"); $from = 26; $to = 28; $dfrom = '20080101'; $dto = '20080331'; $stmt=mssql_init("FokonyvKartonLista", $conn); mssql_bind($stmt, "@FszamTol", $from, SQLINT4); mssql_bind($stmt, "@FszamIg", $to, SQLINT4); mssql_bind($stmt, "@DatumTol", $dfrom, SQLCHAR); mssql_bind($stmt, "@DatumIg", $dto, SQLCHAR); $r=mssql_execute($stmt); var_dump($r); if (!$r){ $message = "Last message from SQL : " . mssql_get_last_message() .""; echo $message; } while ($s = mssql_fetch_row($r)) { echo "Row: ".$s[0]."<br />"; } // OR /* do { while ($s = mssql_fetch_row($r)) { echo "Row: ".$s[0]."<br />"; } } while(mssql_next_result($r)); */ mssql_free_result($r); mssql_close($conn); Expected result: ---------------- I expect the returnd rows of the query in the stored procedure. The result of var_dump($r) is: resource(5) of type (mssql result) What does this mean? Actual result: -------------- No result