The mysqli_sqlstate() function returns the SQLSTATE error code for the last error. The error code consists of five characters. "00000" indicates no error. The values are specified by ANSI SQL and ODBC.
string $mysqli->sqlstate;
string mysqli_sqlstate ( mysqli $link )
Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error. The values are specified by ANSI SQL and ODBC. For a list of possible values,
The above examples will output:
Error - SQLSTATE 42S01.
Parameter | Description |
---|---|
link | Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init() |
Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no error.