Possible Duplicate:
Reference – What does this symbol mean in PHP?
I was wondering what @ means in PHP language. I have seen people using
$connect = @mysql_query('sql query here');
Not sure why. Could someone explain it for me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
@operator tells PHP to suppress error messages, so that they will not be shown.For instance, using:
would result in a warning being shown, telling you that the MySQL query is invalid, while
would not.
Note, however, that this is very bad programming practice as it does not make error disappear, it just hides them, and it makes debugging a heck of a lot worse since you can’t see what’s actually wrong with your code.
Instead of using
@, you should disablejusterror_reportinganddisplay_errorsdisplay_errorsin php.ini