Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    set_error_handler question

    Greetings

    Some years ago I made a academic project using PHP and Informix. To catch the messages from Informix and PHP I used the lines on the beggining of script

    $old_error_handler = set_error_handler("myErrorHandler");

    function myErrorHandler ($errno, $errstr, $errfile, $errline) {
    }

    and in the end of script I used

    restore_error_handler();


    This worked. Now I'm using MySQL and PHP 4.3.4 on a project and these lines not work. I use this but I still see the warning messages on displayed on browser (if, for example, the mysql connection fails). How can I trap these messages? What is the technique?

    Thank you

    Sérgio

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Put error_reporting(0) at the top of your page, but I would advise against it personally.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •