Func Mysqli Sqlstate
# PHP mysqli_sqlstate() Function
[ PHP mysqli Reference](#)
Returns the SQLSTATE error code for the last MySQL operation:
* * *
## Definition and Usage
The mysqli_sqlstate() function returns the SQLSTATE error code for the last error.
The error code contains five characters. "00000" indicates no error. The values are specified by ANSI SQL and ODBC.
* * *
## Syntax
mysqli_sqlstate(_connection_)_;_
| Parameter | Description |
| --- | --- |
| _connection_ | Required. Specifies the MySQL connection to use. |
## Technical Details
| Return Value: | Returns a string containing the SQLSTATE error code for the last error. |
| :--- |
| PHP Version: | 5+ |
* * PHP mysqli Reference](#)
YouTip