PHP 8.5.0 Beta 1 available for testing

Voting

: five plus one?
(Example: nine)

The Note You're Voting On

miqrogroove at gmail dot com
12 years ago
Here are more details about error checking and return values from multi_query(). Testing shows that there are some mysqli properties to check for each result:

affected_rows
errno
error
insert_id
warning_count

If error or errno are not empty then the remaining queries did not return anything, even though error and errno will appear to be empty if processing further results is continued.

Also note that get_warnings() will not work with multi_query(). It can only be used after looping through all results, and it will only get the warnings for the last one of the queries and not for any others. If you need to see or log query warning strings then you must not use multi_query(), because you can only see the warning_count value.

<< Back to user notes page

To Top