Home » Database » MDB2 » Bug #6418
mysqli_multi_query and procedures
Details
| Request #6418 | mysqli_multi_query and procedures |
|---|---|
| Submitted | 2006-01-05 11:45 UTC |
| From | akg1 at fmu1 dot net |
| Assigned | lsmith |
| Status | Closed |
| Package | MDB2 |
| PHP Version | 5.0.5 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-01-05 11:45 UTC] akg1 at fmu1 dot net
Description:
------------
Implementation to execute multiple stored procedures per one connection.
Problem about using mysqli->query can be found here:
http://bugs.php.net/bug.php?id=35203
http://bugs.php.net/bug.php?id=35333
So use of multi_query is needed.
Test script:
---------------
Sample script, when no results are needed:
for($i=0; $i<3; $i++)
{
//asuming we have a valid mysqli object
if (!$mysqli->multi_query("call someStoredProc(1)"))
{
printf("Error: %s\n", $mysqli->error);
}
else
{
do
{
if ($result = $mysqli->store_result())
{
$result->close();
}
} while ($mysqli->next_result());
}
}
This, however will cause an error:
for($i=0; $i<3; $i++)
{
//asuming we have a valid mysqli object
if (!$mysqli->multi_query("call someStoredProc(1)"))
{
printf("Error: %s\n", $mysqli->error);
}
else
{
$result = $mysqli->store_result())
$result->close();
}
}