错误报告无法正常工作

i have a php page

While running it will display following messages

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'test'@'localhost' (using password: NO) in test_step2.php on line 64

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in test_step2.php on line 64

Notice: Undefined variable: exists in test_step2.php on line 341

I want to avoid the displaying of these messages

I have no access to php.ini file

i have tried the following code one by one to avoid the displaying of these messages

  • error_reporting(0)

  • ini_set('display_errors',0);

  • error_reporting(E_NONE);

but no use

Can any one help me to avoid the display of these messages

Disabling the errors here is probably a bad idea. Instead of hiding the messages, you should try to fix them. PHP gives notices for a reason, not fixing them could lead to bigger issues in the future.

You should check your database credentials to fix the connection errors, not just ignore the errors. Don't you need the database in your program? Why else would you connect to it? If you don't need the database, then remove those lines from the script.

Are you including other files that are changing your error settings? If not try

@mysql_select_db(...);

edit .htaccess file

php_value error_reporting 0
php_flag display_errors Off

or contact server administrator...