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
 [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

Pull Requests

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: Thu Dec 26 11:01:30 2024 UTC