• I am using wordpress 1.5.
    Occaisonally, it can’t connect to the database for one reason or another,and it puts up a generic wordpress “cannot establish database connection” message. Not that it looks bad, but I’d like to know how to customize it.
    Any tips on what file to look in for this?

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • That’s a hosting issue – email their support and ask if they have any problems.

    Thread Starter danielos

    (@danielos)

    I know that it’s a hosting problem…. I’m just wanting to know how to customize the error message.

    Moderator James Huff

    (@macmanx)

    You will find the error message in the wp-db.php file. Feel free to customize as you see fit.

    Thread Starter danielos

    (@danielos)

    thanks!

    Thread Starter danielos

    (@danielos)

    Wait. one more question:
    I’m in the middle of making the custom error message right now, so I purposely messed up the config on https://danielosullivan.com/ so I can see what I am doing.

    The CSS info for the database error messages isn’t in wp-db.php file. Only the xhtml part is there. Where can I find the CSS part?

    Probably wp-admin.css

    Given you see this so often you want to style it, I would suggest both backing up your data and moving to a decent host.

    Thread Starter danielos

    (@danielos)

    I don’t really see it that often. I purposely made it happen this time so I could see what I’m doing. It’s only caused by the host once a month or less.

    It would be nice if this error message could be pulled out into a template file somehow. The point isn’t that you need a host that doesn’t go down (always going to be some downtime in a shared hosting environment, which most WP blogs run on I would guess). The point is that the identity of the site is lost for visitors hitting an error. It would be useful to be able to make the error message appear similar to the rest of the site with a message asking them to try back in a while.

    danielos wrote:
    ……………………………………
    : The CSS info for the database error
    : messages isn’t in wp-db.php file.
    :…………………………….

    There is a CSS section. It is at the bottom of includes/wp-db.php

    look just below the following coding:

    function bail($message) { // Just wraps errors in a nice header and footer

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘custom database error message’ is closed to new replies.