Re: How to suppress error messages when using 'new mysqli(...)'

From: Date: Fri, 05 Jan 2007 23:35:00 +0000
Subject: Re: How to suppress error messages when using 'new mysqli(...)'
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-246657@lists.php.net to get a copy of this message
On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote: > Richard Lynch wrote: >> On Fri, January 5, 2007 12:29 pm, Richard Morris wrote: >>> I am having this problem that I hope can be worked around. I make >>> a >>> connection to our MySQL database using the object version of >>> mysqli. >>> If >>> access is denied because of an incorrect username or password, >>> mysqli >>> displays an error. Is there any way to suppress the error message? >> >> To suppress a single error message in a single line you can use the >> @ >> operator in PHP: >> >> @this_code_errors_but_youll_never_see_the_error(...); >> >> To catch errors in a more general manner: >> http://php.net/set_error_handler >> >> Also, since mysqli is new-fangled, it's probably using that fancy >> try/catch/throw stuff, so you could PROBABLY wrap it in a try/catch > > if that was the case his error would have mentioned something about an > uncaught exception. With all the __toString and SPL array/object mumbo-jumbo going on, I never know what's going on anymore with these things... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#246657) next »