Lively discussions on the graphic arts and publishing — in print or on the web

Go Back   Desktop Publishing Forum > General Discussions > Web Site Building & Maintenance

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 12-09-2009, 02:30 AM   #1
Join Date: May 2006
Location: Scottish Borders, UK
Posts: 208
Default PHP connection to MySQL database

I noted recently that a website that I run was down in that none of the PHP scripts could connect to the MySQL database. The site is hosted remotely, I called them as soon as I found out and the problem was solved after a reboot of the MySQL server. There was no apparent reason for the failure...

...so it set me wondering. Had I been away, say for a few days, then the situation could have been more serious and I wouldn't have known anything about it for some considerable time.

I was thinking that instead of what seems to be common practice in PHP of saying connect to the database or display a rather unhelpful error message along the lines of

or die ("sorry, could not connect");

perhaps it would be better to also send an email alert to the administrator saying that there may be a problem.

That seems feasible, but is it a) recommended practice and b) a wise plan, given that it may well swamp your mailbox on a busy site?

On the one hand, if such a problem does arise then you'd like to know about it asap, but on the other hand, might there be an equally serious downside?

john_b is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DSL & WinXP connection timeout problem terrie Software 41 04-25-2008 03:18 PM
Wireless as only connection Paul General Publishing Topics 9 05-30-2006 11:00 AM

All times are GMT -8. The time now is 08:52 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Contents copyright 2004–2019 Desktop Publishing Forum and its members.