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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux