View Full Version : @ with function names?
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.
02-27-2003, 07:32 PM
It surpresses(sp?) the error if there is one
02-27-2003, 07:42 PM
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
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");
@my_function() or die("My function is lazy and incompetent so come back some other time");
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.