The mysqli_error() function returns the last error description for the most recent function call, if any.
mysqli_error(connection);