View Full Version : @ with function names?

02-27-2003, 08: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, 08:32 PM
It surpresses(sp?) the error if there is one

02-27-2003, 08:42 PM

02-28-2003, 12:19 AM
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-28-2003, 12:38 AM
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");

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum