Hello! I'm writing a script that validates a form.... It creates users in a
mysql table, where there are 2 unique columns 'username' and 'email'.

I'm putting mysql_error() into a variable, but I don't want the end user to
see that particular message... is there a way to look at just the key that
has been duplicated, and create a custom error message for user display?

for example, when I duplicate a username, 'jbell', I get this from
mysql_error() : "Duplicate entry 'jbell' for key 2"

I want to be able to see that the error is from key 2, and react

thank you,

Jason Bell

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to