How to hide an error message

前端 未结 3 1170
遇见更好的自我
遇见更好的自我 2020-12-18 12:21

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

相关标签:
3条回答
  • 2020-12-18 12:35

    Yes you can add @ before all mysql queries.

    example:

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

    0 讨论(0)
  • 2020-12-18 12:46

    First line of code before any function in your php script

    error_reporting(0);
    
    0 讨论(0)
  • 2020-12-18 12:49

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

    0 讨论(0)
提交回复
热议问题