MySQL Forums
Forum List  »  Stored Procedures

Re: Calling stored procedure from PHP
Posted by: Arjen Lentz
Date: June 18, 2005 08:48PM

Markus Popp wrote:
> <?php
> $mysqli = new mysqli("localhost", "user", "pw", "database");
>
> if (mysqli_connect_error()) die ("Connection error: ".mysqli_connect_errno());
>
> $result = mysqli->query("call storedprocedure()");
>
> while ($data = $result->fetch_row()) {
> ... // do whatever you want to do with the data
> }
> ?>
>
> My problem is that I can't make another query after this call to the SP without closing the
> connection and creating a new one.

The following is just quick guesswork, but... since CALL does not itself return a result set, result sets returned by the procedure (through a regular SELECT which is passed straight back to the client) may need the "multiple result sets" flag set in the connection setup.
So, that could be the cause of your problem, if you're not finishing retrieving the results in the proper way, the connection won't accept the next query...

Regards, Arjen.
--
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Remote expertise & maintenance for MySQL/MariaDB server environments.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery

Options: ReplyQuote


Subject
Views
Written By
Posted
59437
March 18, 2005 05:58PM
8447
November 26, 2008 05:09AM
22280
April 25, 2005 01:10PM
Re: Calling stored procedure from PHP
3297
June 18, 2005 08:48PM
3976
October 22, 2006 10:03PM
4075
November 03, 2006 02:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.