In PHP, mysqli_error_list() returns a list of errors from the last MySQLi function call as an array of associative arrays.
Object-oriented style reads the $mysqli->error_list property. Each item typically includes errno, sqlstate and error. Most simple queries produce either an empty list or one entry; some operations can return more.
Syntax
Call mysqli_error_list() with the values you need. Start with this line.
PHP
$list = mysqli_error_list($mysqli);
Call
What it does
mysqli_error_list($mysqli)
Returns an array of error entries for the connection.
$mysqli->error_list
Object-oriented property form.
count(mysqli_error_list($mysqli))
Counts how many error entries were reported.
When there is no error, the list is empty. For a quick single message, mysqli_error() is enough. Use error_list when you want structured errno/sqlstate/error fields together.
Library declarations
PHP
mysqli_error_list(mysqli $mysql): array
Parameters
Parameter
Description
mysql
Required. The mysqli connection to inspect.
Return Value
Return Value
Description
array
A list of associative arrays with keys such as errno, sqlstate and error.