Page 1 of 1

@ for what?

Posted: Thu Dec 31, 2009 1:31 pm
by mariolopes
I'm study php now and i have a question (very beginner question I suppose). Why the use of the @ symbol in following code:
function ligacao(){
$connection = @mysql_connect('localhost', 'curso', '123');
mysql_select_db('vendas',$connection);
Thank you guys

Re: @ for what?

Posted: Thu Dec 31, 2009 1:34 pm
by AbraCadaver
@ suppresses errors. You probably shouldn't use it. Turn on error reporting for development and turn it off for production.

Re: @ for what?

Posted: Thu Dec 31, 2009 1:50 pm
by mariolopes
Great
Thank you