I want to hide all mysql error messages without using mysql_error()
.
Are there any solutions?
views:
88answers:
3
+3
A:
First line of code before any function in your php script
error_reporting(0);
markcial
2010-03-18 16:19:49
ok! thanks! and what about some errors exactly?
Syom
2010-03-18 16:21:38
read documentation to get more info http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
markcial
2010-03-18 16:27:31
+5
A:
Put @
in front of your mysql_query
call (@mysql_query('some query');
) to suppress the error messages.
Marek Karbarz
2010-03-18 16:20:48
In this way you get rid of your error messages, but it won't solve problem with your query. Suppressing error messages isn't the right way to do it. You should fix your queries.
Mikk
2010-03-18 17:50:04
This is the best answer as `error_reporting` will suppress ALL non-fatal errors.
Mark Tomlin
2010-03-18 21:41:53
A:
Yes u can add @ before all mysql query...
exmple:
$result = @mysql_db_query ("database","SELECT * FROM agents WHERE ID = '$id'");
khaldonno
2010-03-18 19:20:44