not displaying error messages

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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...


Re: not displaying error messages

*** John Alleyman wrote/escribió (Thu, 19 Aug 2004 08:11:37 +0200):
Quoted text here. Click to load it

Preppend a @ symbol to the offending line:

$conn=@mysql_connect($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 ;-)

Re: not displaying error messages

Quoted text here. Click to load it

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


Site Timeline