not displaying error messages

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

    not displaying error messages

    Hi there,

    Is there a simple way to prevent error messages (falsely connecting to
    database etc.) being diplayed?
    My own build in messages are enough...

    thanks,
    Chris


  • Alvaro G Vicario

    #2
    Re: not displaying error messages

    *** John Alleyman wrote/escribió (Thu, 19 Aug 2004 08:11:37 +0200):[color=blue]
    > Is there a simple way to prevent error messages (falsely connecting to
    > database etc.) being diplayed?[/color]

    Preppend a @ symbol to the offending line:

    $conn=@mysql_co nnect($server, $user, $password)
    or die('System not available');

    You could also change error_reporting in php.ini but that would make it
    almost impossible to debug scripts.

    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- Questions sent to my mailbox will be billed ;-)
    --

    Comment

    • Markus Ernst

      #3
      Re: not displaying error messages

      Alvaro G Vicario <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> schrieb:[color=blue]
      > *** John Alleyman wrote/escribió (Thu, 19 Aug 2004 08:11:37 +0200):[color=green]
      >> Is there a simple way to prevent error messages (falsely connecting
      >> to database etc.) being diplayed?[/color]
      >
      > Preppend a @ symbol to the offending line:
      >
      > $conn=@mysql_co nnect($server, $user, $password)
      > or die('System not available');
      >
      > You could also change error_reporting in php.ini but that would make
      > it almost impossible to debug scripts.[/color]

      I usually use error_reporting (E_ALL) for debugging and error_reporting (0)
      for online running mode. Just write both commands at the top of your file
      (if you have an include in all scripts such as a db login file: put them
      there) and comment out the one that you don't want to be active. Even if you
      have your own error messages it is quite useful to see the original ones for
      debugging.

      HTH
      Markus


      Comment

      Working...