tags:

views:

97

answers:

3

Possible Duplicate:
What is the use of @ symbol in php?

$result = @mysql_query("$query");

Why do we use @ here?

+1  A: 

Suppresses warnings.

Check out: http://php.net/manual/en/language.operators.errorcontrol.php

Bob Fincheimer
+2  A: 

It meas to suppress any error you get when you execute the query.

codaddict
+4  A: 

So nothing is echoed if there are warnings or errors.

It is discouraged to use the @ operator here to force error suppression though; to turn errors like this off it's better to use error_reporting(0).

BoltClock
Using `@` is the equivalent of `$lvl = error_reporting(0); operation(); error_reporting($lvl);` - which is equally unrecommendable. If there is a fatal error, your script will terminate as silently as just using the `@`.
Gordon
do you mean the mysql error is suppressed by default if we use the @ operator?
Ibrahim Azhar Armar
@Ibrahim: yes, just for that one call.
BoltClock
is it not good to include it when the final application is ready.? it is kind of annoying to show the actual error to the end user..
Ibrahim Azhar Armar