php errors

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Tue Mar 09, 2004 7:06 pm    Post subject: php errors Reply with quote

when i've finished testing/writing a script how can i stop error messages like this appearing if there's a problem with my MySQL server:
Quote:
Warning: mysql_connect(): Access denied for user: 'dbmain@localhost' (Using password: YES) in D:\Web\http\Site\renals\links.php on line 30

_________________
Olly
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Mar 10, 2004 1:16 am    Post subject: Reply with quote

http://www.aprelium.com/forum/viewtopic.php?t=1140 shows you how to disable it.

I hate errors also; mostly because it shows I use Windows to run my webserver, which embarrasses me.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Wed Mar 10, 2004 11:45 am    Post subject: Reply with quote

iNaNimAtE wrote:
I hate errors also; mostly because it shows I use Windows to run my webserver, which embarrasses me.
we're in the same boat then :roll:

what i want to know is not how to disable errors for all my php scripts, but select one's after i'm confident that it works properly
_________________
Olly
Back to top View user's profile Send private message
Moxxnixx
-


Joined: 21 Jun 2003
Posts: 1226
Location: Florida

PostPosted: Wed Mar 10, 2004 2:28 pm    Post subject: Reply with quote

olly86 wrote:
what i want to know is not how to disable errors for all my php scripts, but select one's after i'm confident that it works properly
All you have to do is insert an error reporting function at the top of each script.
This will override the php.ini settings.

For example,
error_reporting (E_ERROR | E_WARNING | E_PARSE);
would show everything but notices.

It would look like this:
Code:
<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
// The rest of the script
echo "<P>Hello World! I'm using PHP!</P>\n";
?>


Hope this helps. :wink:
Back to top View user's profile Send private message Visit poster's website
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Wed Mar 10, 2004 6:45 pm    Post subject: Reply with quote

thanks
is their any way to stop notice errors being displayed :roll:
_________________
Olly
Back to top View user's profile Send private message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Wed Mar 10, 2004 9:51 pm    Post subject: Reply with quote

Wasn't that also an option in the php.ini file?
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Wed Mar 10, 2004 10:11 pm    Post subject: Reply with quote

olly86 wrote:
what i want to know is not how to disable errors for all my php scripts, but select one's after i'm confident that it works properly
i already said above i don't want to apply these settings to all my scripts but only to the ones i've finished
_________________
Olly
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Mar 12, 2004 3:46 pm    Post subject: Reply with quote

olly86 wrote:
thanks
is their any way to stop notice errors being displayed :roll:

Search for e_notice in the forum and you'll find how to do.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group