|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46609 can't read out the result from a mssql stored procedure
Submitted: 2008-11-19 09:17 UTC Modified: 2009-03-03 05:32 UTC
From: gyula dot fekete at different dot hu Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: gyula dot fekete at different dot hu
New email:
PHP Version: OS:


 [2008-11-19 09:17 UTC] gyula dot fekete at different dot hu

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, 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:

$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);

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 />";



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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-03 05:32 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 05 15:01:31 2024 UTC