php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23434 multiple recordset in one query
Submitted: 2003-05-01 03:49 UTC Modified: 2003-05-20 03:13 UTC
From: marco_m at inbox dot lv Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.3.1 OS: Windows XP pro
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: marco_m at inbox dot lv
New email:
PHP Version: OS:

 

 [2003-05-01 03:49 UTC] marco_m at inbox dot lv
1) original code is:
=======================================================
$myServer    = "localhost";
$myUser      = "sa";
$myPass      = "sa";
$myDB        = "DB_NAME";

$db1 = @mssql_connect($myServer,$myUser,$myPass);
	mssql_select_db($myDB,$db1);


$sp  = mssql_init("STORED PROCEDURE",$db1);
$rs1 = mssql_execute($sp);

$rs2 = mssql_query("SELECT * FROM TABLE_NAME");

while($frs2=mssql_fetch_array($rs2))
{
 echo "<br>".$frs2["ID"];
}

while ($frs1 = mssql_fetch_array($rs1))
{
 echo "<br>".$frs1["A_TYPE"];
}
=======================================================

problem description:

this simple example works good when STORED_PROCEDURE ( see in $rs1 execute statement ) has only one recordset returned in query. 

But when STORED_PROCEDURE has more than one recordset returned in one query i get the error like 

mssql_query() [function.mssql-query]: Query failed in.... 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-20 01:46 UTC] fmk@php.net
This is not a bug.

MSSQL server can not execute a new SQL statement while data is pending.

You must either fetch all results, release the query or use multiple connections to the server.
 [2003-05-20 03:13 UTC] derick@php.net
Not a bug -> bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 10:01:30 2024 UTC