TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   @ in front of mysql functions (http://www.talkphp.com/general/5546-front-mysql-functions.html)

haskabab 08-14-2010 04:54 PM

@ in front of mysql functions
 
I've always wondered why some people put a "@" in front of mysql functions, like:

Code:

<?php
 
  $query = @mysql_query("some query");

?>

So if anyone would care to explain? Thanks in advance.

tony 08-14-2010 05:36 PM

it is a language construct that suppresses warnings and errors. In this case it won't stop the execution of the script if there is an error or warning.

It is a bad practice though, because if you don't get the results you expected you need to handle them accordingly so that the user of the app/website/script would have a better experience. Plus without it is better to debug.

haskabab 08-14-2010 05:40 PM

Thanks once again xD!


All times are GMT. The time now is 05:44 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0