#23434 [Opn->Csd]: multiple recordset in one query
| From: | fmk@php.net | Date: | Tue, 20 May 2003 06:46:04 +0000 |
| Subject: | #23434 [Opn->Csd]: multiple recordset in one query | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40005@lists.php.net to get a copy of this message | ||
ID: 23434
Updated by: fmk@php.net
Reported By: marco_m at inbox dot lv
-Status: Open
+Status: Closed
Bug Type: MSSQL related
Operating System: Windows XP pro
PHP Version: 4.3.1
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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