Queries That Return No Resultset

So far you've learned how to run a query and check whether it ran successfully. You've also seen how to fetch the resultset, and, in the case of a NULL result, how to check whether this was because of an error or because the query wasn't meant to produce a result, such as with an INSERT or DELETE.

As a result, you've built some resilient code that can run a query of either type. You can modify the SQL query in any of the preceding listings to make it an INSERT, DELETE, and so on, and the code still runs. If there's no resultset from the query, the code produces a message telling you whether this is okay, or whether an error occurred.

However, if you do run a query that is meant to modify your data, how can you ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.