467,145 Members | 1,112 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,145 developers. It's quick & easy.

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
Jul 17 '05 #1
  • viewed: 1712
Share:
2 Replies
*** John Alleyman wrote/escribió (Thu, 19 Aug 2004 08:11:37 +0200):
Is there a simple way to prevent error messages (falsely connecting to
database etc.) being diplayed?


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 ;-)
--
Jul 17 '05 #2
Alvaro G Vicario <al******************@telecomputeronline.com> schrieb:
*** John Alleyman wrote/escribió (Thu, 19 Aug 2004 08:11:37 +0200):
Is there a simple way to prevent error messages (falsely connecting
to database etc.) being diplayed?


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.


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
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Gregory | last post: by
1 post views Thread by Andrew Dabrowski | last post: by
7 posts views Thread by swethasivaram@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.