acedanger Posted April 29, 2006 Share Posted April 29, 2006 I've been searcing around the web and have noticed some people using the @ symbol in front of mysql_* functions. What does the @ symbol mean and what does it do? Quote Link to comment https://forums.phpfreaks.com/topic/8704-solved-symbol-usage/ Share on other sites More sharing options...
wildteen88 Posted April 29, 2006 Share Posted April 29, 2006 It surpresses error messages, which means it hides the error message which is good on a production server (live site) but not when you are on devlopment server (making your script).Take this example:[code]<?phpif($_GET['var'])){ echo $_GET['var'] . '<br /><br />';}?><a href="?var=hello">Set $_GET['var'] </a>[/code]When you run that code depending on you error reporting level and whether display errors is enabled you'll get an notice message like this:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Notice: Undefined index: var in path/to/file.php on line 3[/quote]When you add the @ symbol in front of the $_GET['var'] variable it wont show the error message.Hope that helps. I dont really recommend the use of the @ symbol, unless it is really nessecary, as it is a from of lazy programming. Quote Link to comment https://forums.phpfreaks.com/topic/8704-solved-symbol-usage/#findComment-31946 Share on other sites More sharing options...
acedanger Posted April 29, 2006 Author Share Posted April 29, 2006 Thanks wildteen88, that's exactly the kind of information I was looking for! Quote Link to comment https://forums.phpfreaks.com/topic/8704-solved-symbol-usage/#findComment-31947 Share on other sites More sharing options...
Brandon Jaeger Posted April 30, 2006 Share Posted April 30, 2006 Thank you :) Quote Link to comment https://forums.phpfreaks.com/topic/8704-solved-symbol-usage/#findComment-32113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.