PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #6418

mysqli_multi_query and procedures

Details

Request #6418mysqli_multi_query and procedures
Submitted2006-01-05 11:45 UTC
Fromakg1 at fmu1 dot net
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.0.5
OSLinux
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();
}
}