开发者

How to hide an error message

开发者 https://www.devze.com 2022-12-23 15:20 出处:网络
I want to hide all mysql error messages without using mysql_e开发者_JS百科rror(). Are there any solutions?First line of code before any function in your php script

I want to hide all mysql error messages without using mysql_e开发者_JS百科rror(). Are there any solutions?


First line of code before any function in your php script

error_reporting(0);


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


Yes you can add @ before all mysql queries.

example:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消