PHP mysqli_sqlstate() Function

PHP mysqli_sqlstate() function returns the SQLSTATE error code from the previous MySQL operation.

Syntax

mysqli_sqlstate() Function Parameter

ParameterDescription
connection :Required parameter. The MySQL connection to be used

mysqli_sqlstate() Function Return Value

Return Values :Returns a string containing the SQLSTATE error code for the last error.

mysqli_sqlstate() Function Example