question about @

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sk

    #1

    question about @

    can someone explain the difference between

    while ($row = mysql_fetch_arr ay($result, MYSQL_NUM))
    while ($row = @ mysql_fetch_arr ay($result, MYSQL_NUM))

    in other words, what is the @ used for....

    thanks
  • Erwin Moller

    #2
    Re: question about @

    sk wrote:
    can someone explain the difference between
    >
    while ($row = mysql_fetch_arr ay($result, MYSQL_NUM))
    while ($row = @ mysql_fetch_arr ay($result, MYSQL_NUM))
    >
    in other words, what is the @ used for....
    >
    thanks
    errorsupression .

    If anything failt after the @, the errormessage (or warning) will NOT be
    displayed.

    Regards,
    Erwin Moller

    Comment

    • Pedro Graca

      #3
      Re: question about @

      sk wrote:
      what is the @ used for....
      It's used to eliminate error messages generated by an expression.


      Example:

      <?php
      error_reporting (E_ALL);
      ini_set('displa y_errors', '1');

      unset($bar, $q);

      $foo = $bar; // use of uninitialized variable ($bar)
      $bar = @ $q; // error message suppressed
      ?>

      --
      I (almost) never check the dodgeit address.
      If you *really* need to mail me, use the address in the Reply-To
      header with a message in *plain* *text* *without* *attachments*.

      Comment

      Working...