Standard service - a fixed amount of work that is performed at a fixed price.  Post Service

  

Saturday, 14 September 2019 04:30

mysqli Strict Standards

Written by  http://blog.mclaughlinsoftware.com/2019/09/14/mysqli-strict-standards/
Rate this item
(0 votes)

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());

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

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);

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());

do { ... } while($stmt->more_result());

As always, I hope this helps those looking for an answer.

Read 36 times

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.