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

From: Date: Fri, 05 Jan 2007 23:34:05 +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-246656@lists.php.net to get a copy of this message
On Fri, January 5, 2007 4:35 pm, Jochem Maas wrote: > sidenote: where exactly do you put the @ to suppress the error in this > line?: > > $db = new mysqli('localhost', 'user', 'badpass', > 'test'); Since it is the 'new' operator which is issuing the WARNING, as far as I can tell, you should put it in like this: $db = @new mysqli(...); It's POSSIBLE to put @ in front like this: @$db = new mysqli(...); when the assignment itself issues the error, such as: @list($x, $y, $z) = each(array(1, 2)); //note the lack of a third element to assign to $z But it seems excessive here to need it in front of $db... -- 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 (#246656) next »