Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The function of @

    I know this is an idiot question, but what does "@" do?

    I've never really been sure, and it just occured to me to ask.

    Thanks for tolerating the idiot!

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Puttin @ in front of something surpresses any errors that occur from using it... So say you wanted to connect to MySQL, but if the connection fails you dont want any kind of warning, you could use:

    PHP Code:
    @mysql_connect('...''...''...'); 
    It is useful for live use and functions where you manually check for errors, but NEVER get into the habbit of using this when developing code.

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    153
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I use this when developing code ONLY when I have custom errors to take the place of the default one. I like to do this because I don't like the ugly errors that PHP outputs, and to do this, I have to put @ in front of the functions that can output errors (the default ones, I am not sure that it works for user-made functions...).

    -Yaggles


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •