Current Location: Home> Latest Articles> When Executing Multiple Queries, How to Use mysqli::$info to Retrieve the Execution Status of Each Query?

When Executing Multiple Queries, How to Use mysqli::$info to Retrieve the Execution Status of Each Query?

gitbox 2025-09-18
<span><span><span class="hljs-meta"><?php</span></span><span>
</span><span><span class="hljs-comment">// Preface content not related to this article and code examples</span></span><span>
</span><span><span class="hljs-keyword">echo</span></span><span> </span><span><span class="hljs-string">"This could be an ad slot, an announcement, or other unrelated information."</span></span><span>;
<p></span>echo "<hr>"; // Use a horizontal line to separate non-article content from the main content<br>
?></p>
<p><h1>When Executing Multiple Queries, How to Use mysqli::$info<span> to Retrieve the Execution Status of Each Query?</h1></p>
<p><p>When using <code>mysqli

4. Example Output

Suppose there was no user named Alice in the table originally. After execution, the program may output something like this:

Execution Status: Records: 1  Duplicates: 0  Warnings: 0
Execution Status: Rows matched: 1  Changed: 1  Warnings: 0
Execution Status: Records: 0  Deleted: 0  Warnings: 0

5. Conclusion

By combining mysqli::multi_query() with mysqli::$info, we can efficiently execute multiple SQL statements and track their execution status one by one. This method is particularly useful when processing data in batches or debugging complex SQL executions.

```