View Full Version : @ with function names?
ScottInTexas
02-27-2003, 07:16 PM
I notice some cases where the author hass put @fopen() or @mysql_select_db. What is the @ for? I tried to look it up in the php manual at php.net but I can't find a reference.
Nightfire
02-27-2003, 07:32 PM
It surpresses(sp?) the error if there is one
ScottInTexas
02-27-2003, 07:42 PM
Thanks:)
What you mean is that @mysql_connect() it ignores if there is an error during DB Conection and so...?
sory but I'm a noob
Spookster
02-27-2003, 11:38 PM
Yes. By placing the @ symbol in front of a function name, it supresses any errors that might be generated by that function. It is common to use that in conjunction with displaying a customized error message to the user. For example:
@mysql_connect() or die("The database is currently down. Please try again later");
or
@my_function() or die("My function is lazy and incompetent so come back some other time");
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.