Six years ago I wrote a common lookup post to illustrate the effectiveness of things used throughout your applications. Now, I’m updating my student image with a more complete solution to show how to avoid update anomalies.
In the prior post, I used a while
loop in PHP, like the following:
do {
...
} while($stmt->next_result());
Using PHP Version 7.3.8 and MySQL 8.0.16, that now raises the following error message:
Strict Standards: mysqli_stmt::next_result(): There is no next result set. Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check whether to call this function/method in /var/www/html/app/library.inc on line 81
You can see this type of error when you set the following parameters in your file during testing:
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(E_ALL);
You can read more about error handling at this web page. The new and strict compliance standard for mysqli
managing rows is:
do {
...
} while($stmt->more_result());
As always, I hope this helps those looking for an answer.