Results 1 to 3 of 3

Thread: Why '@' ?

  1. #1
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Unanswered: Why '@' ?

    Hi all
    This would be quiet simple for all.. but I don't know why @ is used before some functions like
    @session_start()
    @print()

    why this is used though the out put is same..

    Regards
    Rajesh
    Freelance and Technology Consultant
    -------------------
    Dreams are for ever
    -------------------

  2. #2
    Join Date
    Jul 2003
    Posts
    73
    When you use a @ character - the errors that are returned are surpressed.

    I use it when calling a DB query. For example:
    Code:
    $result = @mysql_query($query);
    If I didn't have the @ before the function, and the query failed, the error would be echo'd to the output (depending on php.ini options). I can still get the error my calling mysql_error() or something simliar.
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    168
    Thank you very much
    Freelance and Technology Consultant
    -------------------
    Dreams are for ever
    -------------------

Posting Permissions

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