#23434 [Csd->Bgs]: multiple recordset in one query

From: Date: Tue, 20 May 2003 08:13:13 +0000
Subject: #23434 [Csd->Bgs]: multiple recordset in one query
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40009@lists.php.net to get a copy of this message
ID: 23434 Updated by: derick@php.net Reported By: marco_m at inbox dot lv -Status: Closed +Status: Bogus Bug Type: MSSQL related Operating System: Windows XP pro PHP Version: 4.3.1 New Comment: Not a bug -> bogus Previous Comments: ------------------------------------------------------------------------ [2003-05-20 01:46:03] 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-01 03:49:35] 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.... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23434&edit=1

« previous php.bugs (#40009) next »