• Not sure why I’m getting this error.

    WP is installed and content is loaded just fine. But for reasons that I have yet to understand (or trackdown) I get this error on certain parts of the code at certain unpredictible times:

    WordPress database error: [No Database Selected] with more specific DB table stuff below specific to where it was making the DB call.

    This seems to happen on secondary type links like where it’s supposed to populate the “Category” or the “Next Post”, “Previous Post” Links. Yet, I can see the content of the “post” just fine. So getting that part from the DB seems to be fine, but for other things it looses the connection somehow.

    If I reload the page a couple of times, it seems to go away. A single page reload won’t do it. But then it will happen on another page.

    Any help would be appreciated since work is for a client who was all excited about having part of the site run on WordPress, but now I don’t want to scare him into thinking that he will have similar problems.

    I have WP 1.5 right now, and never saw this before in 1.2.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter espek

    (@espek)

    Call off the hounds. Found the problem and it had nothing to do with WP code.

    Thanks anyway folks.

    I’d be interested in knowing what you did. I have this problem, too: an intermittent, yet persistent error when making subsidiary calls to the database for category lists, etc. I created some screen shots, if anyone is interested enough in taking a look to see if they can help:

    Any help gratefully appreciated. Thanks.

    Sorry, ought to explain: using WordPress 1.5.1.1. Home page, though see screen shots posted above if the problem not in evidence. Error message takes the form:

    WordPress database error: [No database selected]
    SELECT cat_ID, cat_name, category_nicename, category_description, category_parent FROM wp_categories WHERE cat_ID > 0 ORDER BY cat_ID asc

    Could this be a problem with my WordPress installation, or the database itself? I’ve tried disabling plugins, but the problem remains.

    No ideas? Is a database backup and WordPress reinstall necessary?

    I had the same problem after copying the whole environment from one server to another. I found my solution here:
    http://wordpress.org/support/topic/36462
    Thanks Righton!

    That was it! Moving the Shortstat include to the top of the document solved the error. Groovy. And after all that confusion!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress database error: [No Database Selected]’ is closed to new replies.