samedi 27 août 2016

how to get column names in PDO error?

when I use PDO errorInfo

I get this :

Array ( 
[0] => 23000
[1] => 1062
[2] => Duplicate entry 'zzz@zzz.net' for key 'email'
) 

but I wanna get only column name > 'email' and 1062 for error code to echo :

this email zzz@zzz.net already registered

because I use email or phone or username for registration

Aucun commentaire:

Enregistrer un commentaire