hi all
i'v been just tracing a source , there was a command as below :

@mysql_select_db(MYDATABASE,$res);

I Know that's a comnad for connecting to mysql but i couldn't get what's "@", and i coldn't find anything about it in php manual !!!

any clue ????

    If I remember correctly, @ appended to the beginning of a statement will suppress any errors that, that statement might cause.

      The previous post is correct putting @ at the begining of a function call will surpress any errors that are returned.

      I would however note that this is NOT a good idea, the whole point of error messages to to bring your attention to problems in your program.

      Also without error messages then the issue of debugging becomes a COMPLETE NIGHTMARE

      HTH

      GM

      Originally posted by mahrou
      hi all
      i'v been just tracing a source , there was a command as below :

      @mysql_select_db(MYDATABASE,$res);


      I Know that's a comnad for connecting to mysql but i couldn't get what's "@", and i coldn't find anything about it in php manual !!!

      any clue ????

        Good for production code on a site once you have fully tested it and know it works.. this way the general users won't get confused! (depending on your viewer base, they would most likely have NO idea what php or mysql even IS, let alone understand the errors)

        Just makes it a bit more user friendly.. usually it's a good idea to put a variable in your script that lets you turn errors on or off.. aka: Debug mode! 🙂

          Write a Reply...