note 76632 deleted from mysqli-stmt.execute by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:00:15 +0000 |
| Subject: | note 76632 deleted from mysqli-stmt.execute by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196711@lists.php.net to get a copy of this message | ||
Note Submitter: Amit S.
----
I decided to use mysqli since I could use prepared statements for my stored procedures. To me, this
is good so I don't have to worry about SQL injection by doing this. No dynamic SQL on the PHP
end or in my stored procedure.
Anyways, I would open one connection to the database and run multiple stored procedures. On the
second stored procedure, I would get this error - lost connection - and I know that none of my
queries are long running where I would hit a timeout.
To me, I just care about the result set that my stored procedure is producing, which is only one
result set. The rest can be safely ignored. If you are in the same boat as me, this is what you can
do:
After you are done getting the resultset from mysqli, do the following before you execute the next
query:
while(mysqli_more_results($conn)) {
mysqli_next_result($conn);
}