0
I have a return of any error in php, for example.
QLSTATE[23000]: Integrity Constraint Violation: 1062 Duplicate entry
I wish I could get that specific code in case the 1062
, recalling that the getCode
of Exception
he would return the 23000
.
I want to know how to know if this particular section is contained in this string
.
Depending on the library you are using, the error code is already assigned the exception (Inner Exception) or the driver error. Which library you are using (PDO, Mysqli, etc...)?
– Gabriel Heming