PDO::errorCode – Retrieve the SQLSTATE of the Last Database Operation
PDO::errorCode is a PHP method that returns the SQLSTATE code—a five‑character identifier defined by the ANSI SQL standard—representing the outcome of the most recent operation on a database handle, or NULL if no operation has been performed.
mixed PDO::errorCode(void)
Returns an SQLSTATE, a five‑character identifier defined in the ANSI SQL standard, consisting of a two‑character class value followed by a three‑character subclass value.
Parameters
This function takes no parameters.
Return value
If the database handle has not performed any operation, it returns NULL ; otherwise it returns the SQLSTATE string.
Laravel Tech Community
Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.