RE: [PHP] How to Show my Own Error Message Instead of Mysql Error ?

From: Date: Fri, 21 Jun 2002 04:08:33 +0000
Subject: RE: [PHP] How to Show my Own Error Message Instead of Mysql Error ?
Groups: php.db php.general php.windows 
Request: Send a blank email to php-db+get-19929@lists.php.net to get a copy of this message
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:nedcor4@nedcor.com.hk] Sent: Friday, June 21, 2002 2:07 PM To: php-db@lists.php.net; php-general@lists.php.net; php-windows@lists.php.net 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! Jack nedcor4@nedcor.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#19929) next »