Hi!
I tried searching for a solution in this website but I can't seem to find any.
I needed to find a way to know which field in my table is causing the constraint error.. In my table, say members
table two fields (username,email) are unique keys and defined as unique keys apart from my primary key (memberid). When i add data to this table for a similar user and/or email address this error occurs:
"duplicate entry '[email protected]' for key2"
i want to tell the user which field is causing duplicate entry so as to say "that email is already registered"
I cannot seem to find a mysql function to loop through error keys upon insert...
Thanks in advance!