Re: MySql_Error();

From: Date: Thu, 04 Jul 2002 22:50:28 +0000
Subject: Re: MySql_Error();
Groups: php.general 
Request: Send a blank email to php-general+get-105536@lists.php.net to get a copy of this message
>Please, How do I make to get all errors of MySql ? Don't :-) >I'm making a function for translate all errors. Example: > >function TranslateErrors($err) >{ > global $result; > global $text; > Switch ($err) > { > case 1045 : > $text = "User or Password invalid"; > Break; > case 2005 : > $text = "Host not exists"; > Break; > case 1049 : > $text = "Database not exists"; > Break; > } > result = $text; >} function TranslateErrors($err){ return mysql_error(); } http://php.net/mysql_error If you need that translated into different languages, there are facilities for that. I don't know a whole lot about them, but doing it the way you are doing it above is almost for sure not the right way to go about it. If you *REALLY* want the full list, you can dig it out of MySQL source code, but it changes from time to time, if not with every release. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#105536) next »