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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts

    @ with function names?

    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.
    Scott Stewart
    Always happy to learn from pros.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    It surpresses(sp?) the error if there is one

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Posts
    567
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Thanks
    Scott Stewart
    Always happy to learn from pros.

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question what do you mean?

    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

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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");

    or

    @my_function() or die("My function is lazy and incompetent so come back some other time");
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

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