On the All Forces blog today, Melvin Rivera has posted a new tutorial for all of those WordPress users out there wanting to make a custom database error message page.
The database connection error occurs when WordPress tries o connect to the database but does not succeed at it. When you are first installing WordPress, it can mean that your settings are incorrect. i.e. the username/password are wrong. However, if your WordPress installation is running smoothly but for some reason MySQL goes down on your server then WordPress will show that huge "WordPress, Error Establishing a Database Connection" error page that looks nothing like the rest of your site.
The error page is great when you are first setting up WordPress but it is not the most ideal for a professional website. It creates confusion for the visitor that might not even know what WordPress is. What's worst, the web developer might not even find out for hours.
He guides you through making a small modification to WordPress itself (to change the page location), including the exact code to change. He also includes a brief it of PHP code to place on this custom page to email you whenever it hits this page (so you'll know it's down). From there, it's just about creating the custom error page that fits into your template. And, of course, he suggests testing it briefly, just to ensure that everything's on the up and up. Files are included where code was referenced.