PHP mysqli_error_list() function is used to get list or array of errors for the most recent MySQLi function call.
Syntax
array mysqli_error_list(connection);
Parameter | Description |
---|---|
connection : | Required parameter. The MySQL connection to be used |
Return Values : | An error code value for the last call, if it failed. zero means no error occurred. |
<?php $con = mysqli_error_listt("localhost","user","password","db"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } if (!mysqli_query($con, "SELECT * FROM employee")) { echo "Error Code: " . mysqli_error_list($con); } mysqli_close($con); ?>