tags:

views:

88

answers:

3

I want to hide all mysql error messages without using mysql_error(). Are there any solutions?

+3  A: 

First line of code before any function in your php script

error_reporting(0);
markcial
ok! thanks! and what about some errors exactly?
Syom
read documentation to get more info http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
markcial
+5  A: 

Put @ in front of your mysql_query call (@mysql_query('some query');) to suppress the error messages.

Marek Karbarz
oooooo, that's perfect!!! thanks
Syom
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
This is the best answer as `error_reporting` will suppress ALL non-fatal errors.
Mark Tomlin
A: 

Yes u can add @ before all mysql query...

exmple:

$result = @mysql_db_query ("database","SELECT * FROM agents WHERE ID = '$id'");

khaldonno