Example 1 — Read a Success SQLSTATE
Demo of the common no-error code.
<?php
$sqlstate = '00000'; // typical success-style sample
echo 'sqlstate=', $sqlstate, PHP_EOL; How It Works
- After a successful operation, SQLSTATE is often 00000.
- Procedural code calls mysqli_sqlstate($link).
- OO code reads $mysqli->sqlstate.
- Sample output when connected to a demo database matches this success code.

