note 111126 modified in mysqli.multi-query by danbrown
| From: | danbrown@php.net | Date: | Thu, 17 Jan 2013 21:44:33 +0000 |
| Subject: | note 111126 modified in mysqli.multi-query by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193185@lists.php.net to get a copy of this message | ||
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.
--was--
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
As noted in an earlier comment, 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.
http://php.net/manual/en/mysqli.multi-query.php