Is there any difference between: $id = @mysql_result($sql,0,"id"); and $id = mysql_result($sql,0,"id"); Note the @ sign before the mysql_result function. There is nothing in the Manual about, but there are snipetts around...
The @ suppresses any error that the function would give. You would normally use this to prevent showing the actual error to the end user. Best bet is not to suppress but to use something like: if(!$id = mysql_result($sql,0,"id")) { die("There was an error with the result!"); } or if you want to see the error: if(!$id = mysql_result($sql,0,"id")) { die(mysql_error()); }
Surpressing errors with @ is bad and slows down your scripts. As the previous poster said, you have to look for it and then handle the error correctly within the if statement. Otherwise it's possible that the script continues execution and results in incorrect data being inserted in the DB, etc.. If you want to surpress errors, simply use this: ini_set('display_errors', 0); PHP: