what about doing a "select count(*) from table where username = 'foobar'"
then, if ($cnt > 0) { /* display error */ } else { /* insert new username */

-----Original Message-----
From: Jack [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 21, 2002 2:07 PM
Subject: [PHP] How to Show my Own Error Message Instead of Mysql Error?

Dear all
i made a Registration Form for user to input their Data, but i also had some
Field Check before the data can be insert to the Mysql_Database!
I had a question here, sometime the mysql shows the error :
"Duplicate Key for xxx"
I know what is this about, reguarding to my Registration Form, it mean the
Login Name is Duplicated! But i want to show my own message to the user for
this error instead the Mysql Error! It is meanness to show User the Mysql
Error, cause they won't understand it!!!

Could Someone pls tell me how i can do this?

Thx a lot!

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to