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