Re: How to Show my Own Error Message Instead of Mysql Error?

From: Date: Fri, 21 Jun 2002 06:15:01 +0000
Subject: Re: How to Show my Own Error Message Instead of Mysql Error?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-103235@lists.php.net to get a copy of this message
<jack> But i want to show my own message to the user for this error . </jack hello Jack, do a check of the insert was successfull and redirect with php to your original page and include a error var e.g if (!mysql...) HEADER(LOcation:....file.php?error=mysqlfailed Then on your sign up page do an error check if (!empty($errror)) switch ($error){ case 'mysqlfailed': echo 'please choose a different user name...'; break; } Good luck, andy -- ---------------------------------------------------- http://www.globosapiens.net Global Travellers Network! "Jack" <nedcor4@nedcor.com.hk> schrieb im Newsbeitrag news:20020621040711.69634.qmail@pb1.pair.com... > 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 > >

« previous php.general (#103235) next »