Support » Fixing WordPress » Problem with database table names

  • wxgal


    I have recently installed WP 1.2 (I’m moving from MT). I’ve got it all installed and working fine with the default templates and styles.
    I have gone to work and changed the layout to match (as closely as possible) my MT layout. The posts themselves are showing up fine .. just how they should. But I’m having trouble with the sidebar.
    I’m talking about the links list and the categories list and the calendar and the archives (monthly) list.
    Everything works fine with the original index template. I use the exact same code on my modified index template and I get an error stating:
    Database error: [Table ‘bresler_www.wp_categories’ doesn’t exist]
    The actual database table name is “wp_categories”. It’s for some reason adding “bresler_www.” to the beginning of it. I have no idea where that’s come from. That is the name of another database that I have, but it has nothing to do with my WP install.
    I cannot figure out why this is being added or even where it’s being added. It only happens on my modified index template. As far as I know, I have left all of the needed code in the template. I just basically moved stuff around.
    You can find the original index template here:
    My modified index template is here:
    Does anyone have any ideas as to why this is happening?

Viewing 3 replies - 1 through 3 (of 3 total)
  • wxgal


    Well, I found part of the problem. I accessed a different database for the weather info that I have in the sidebar. I closed that connection, so I’m not getting the errors anymore. But it’s not displaying the info either. Still trying to debug.



    Well, it’s official. My weather thingy is messing up my sidebar. And the weather thing is something I want there. Guess I’m gonna have to figure some way around this.
    Boy it’s good to figure out the answers to my own questions. Now if I could just figure out the conflict and resolve it … LOL.



    It means that whatever db access is being done after the Weather hack that is problematic is NOT passing the originally opened DB handle to the MySQL access functions. By default, if no DB handle is supplied, the functions use the last-opened db.
    I can’t remember if I fixed this in my code at some point — and to that end, can’t remember if I ever looked to see if it was properly handled in newer WP versions (I’m still on a 1.0 derivative…).
    Also, if you want to post ‘code links’, post them to .phps copies of your code, or we can’t actually see the code itself to try to help… 😉

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem with database table names’ is closed to new replies.