WordPress.org

Ready to get started?Download WordPress

Forums

124

Solution for 2.3 database errors / wp_post2cat does not exist (101 posts)

  1. Arnee
    Member
    Posted 6 years ago #

    If you are getting a database error like this:

    WordPress database error: [Table 'wp_post2cat' doesn't exist]
    SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts, UNIX_TIMESTAMP(max(posts.post_date_gmt)) + '8' AS last_post_date, UNIX_TIMESTAMP(max(posts.post_date_gmt)) AS last_post_date_gmt FROM wp_post2cat p2c INNER JOIN wp_posts posts ON p2c.post_id=posts.id WHERE 1 = 1 AND posts.post_type = 'post' AND posts.post_status = 'publish' AND posts.post_date_gmt <= '2007-09-19 12:08:25' GROUP BY p2c.category_id ORDER BY numposts DESC

    or like this:

    WordPress database error: [Table 'wordpress.wp_post2cat' doesn't exist]
    SELECT c.cat_name FROM wp_post2cat p2c INNER JOIN wp_categories c ON p2c.category_id = c.cat_id WHERE p2c.post_id = 218

    or like this:

    WordPress database error: [Table 'wordpress.wp_post2cat' doesn't exist]
    SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM wp_posts p LEFT JOIN wp_post2cat pc ON p.ID = pc.post_id LEFT JOIN wp_categories c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ID

    or any other database error which contains wp_post2cat or wp_categories, you are using a plugin or theme which is not compatible with WordPress 2.3.

    Example plugins which don't work:

    It could also be that your theme is causing this error:

    Please double check before posting that you don't use any incompatible plugins. A list of plugins that work and which won't work can be found at the WordPress Codex.

  2. spencerp
    Member
    Posted 6 years ago #

    Also, another reason for DB errors spitting out with themes, is because alot of the themes aren't updated to the new 2.3 code! The original themes are using OLD CODE in them, resulting in Database Errors showing on blogs... Example here.

    Oh yeah, in case this was overlooked before, I made up a theme compatibility list for 2.3...
    http://codex.wordpress.org/Themes/Theme_Compatibility/2.3

    For adding tags to your themes, view this guide.

  3. guxo
    Member
    Posted 6 years ago #

    how can i upgrade my theme manualy?
    what functions do i need to rename to get my theme compatible with wp2.3?

  4. spencerp
    Member
    Posted 6 years ago #

    I'm not sure what theme you're using, nor do I know how it's coded really. Only thing I can suggest, is, look through the prepackaged Default and Classic themes that came with your WordPress 2.3 download, and see how things were done in there... Unless someone else knows more, I'm not sure?

  5. guxo
    Member
    Posted 6 years ago #

    i create a table named wp_categories, create a 3 values: cat_id, cat_name and link_count.

    the error disappear.
    is this getting me troubles in the future?

  6. Ricardo Gonzalez
    Member
    Posted 6 years ago #

    guxo, this is not a solution. the error is gone, but the table is empty, so the plugin, themes, etc who want access it will fail...

  7. guxo
    Member
    Posted 6 years ago #

    what's the wp_categories funcionality? what's used for?

  8. foolswisdom
    Moderator
    Posted 6 years ago #

    guxo, for categories, your theme has to be updated to use the new taxonomy tables instead.
    http://codex.wordpress.org/index.php?title=Version_2.3:New_Taxonomy

  9. 10cplay
    Member
    Posted 6 years ago #

    I'm getting the same

    Table 'wordpress.wp_post2cat' doesn't exist

    I don't see a fix above... anybody got a clue on this one?

    It's ok saying the theme is written from old code... but is the fix..what the NEW code we should be putting in.

    Very frustrating.

  10. spencerp
    Member
    Posted 6 years ago #

    Old code as in this example here. The code is querying for tables that were removed during/after upgrade from 2.X versions to 2.3.

    Themes in general will need to be tweaked, and searched through for such "old code" to replace it with new query calls. Which I believe "foolswisdom" was pointing out above there. I'm not a PHP/MySql database Guru, so I'm only throwing out my speculations.

  11. guxo
    Member
    Posted 6 years ago #

    I'm sorry if I'm quite boring, but i take 3 month to find my actual template.. so i won't let anyone take it from me!!!!!!!!!!!!!!!!!
    looooool
    can i change all old terms with the new table terms?
    if i left the wp_category empty what's going to happen? does my posts disappear? i don't use the tags system.. bu i still use the categories.. will something with categories system fail?

    tks for you patience.

  12. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    It's ok saying the theme is written from old code... but is the fix..what the NEW code we should be putting in.

    We can't tell you that, because we don't know what the old code actually does. You haven't told us what the old code actually *is*, have you?

    What color is my hat? You can't tell me, because you haven't seen my hat.

    Start a new thread. Post the section of your theme that is not working anymore. Maybe somebody can help you fix it. Maybe not. But just getting frustrated doesn't fix the issue.

  13. George
    Member
    Posted 6 years ago #

    Okay why is the new version 2.3 advertised as most themes are not compatible?

    Now if I would use the classic theme this message should not appear right. But I do have a database error.
    Do I have another problem here?

    WordPress database error: [Table 'wordpressdb.en_terms' doesn't exist]

    http://www.georgelangenberg.com/blog

  14. mission
    Member
    Posted 6 years ago #

    That is a good question george. I think, most of wp users do not use the default or classic theme.
    I just upgraded to 2.3, than got the error message:
    WordPress database error: [Table 'mission.wp_categories' doesn't exist]
    SELECT COUNT(*) FROM wp_categories
    My only luck was, that I made a db backup, so I did put back 2.2.2. I think Im gonna wait for a while with this upgrading to 2.3...

  15. George
    Member
    Posted 6 years ago #

    I will do the same tomorrow, Mission. I also made a backup of the database. Where cn I download 2.2 ( I have over written those files).
    Damn this version! Upgrading used to be smooth. Now I have a broken blog running. 2.3 = not recommendable for non-coders (like me).

  16. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Okay why is the new version 2.3 advertised as most themes are not compatible?

    We don't have any information on how many themes are compatible.

    A well-written theme would be perfectly compatible. But a theme doing its own SQL queries like you're talking about probably would not.

    There is no circumstance I can think of that a theme should actually make its own SQL queries.

  17. theenterprise17
    Member
    Posted 6 years ago #

    In many cases the non working themes are calling the database directly in the sidebar.php or header.php file in the template to get you list of catigories. wp-list-catigories is the tag that you wanna use to accomplish this effect.

  18. George
    Member
    Posted 6 years ago #

    Otto, honestly I have no clue what your talking about. Like I said before, upgrading used to be easy. I do not now what an SQL querie is. Up to now all WP themes worked fine and some plugins did not work well together. I can understand that and this is the reason why I liked blogging with WordPress. So now I do not understand why the database broke down in my own blog, this upgrade round. I don't know if it's the theme or anything else...

    theenterprise17, I guess this won't come as a plugin.

    P.S. even when I use a 2.3 ready theme (for example Silverlight) the database keeps broken...

  19. AffinityEnterprises
    Member
    Posted 6 years ago #

    In my styles.css, I have #categories to tell the system that the sidebar format applies.

    However, in 2.3 Categories no longer exist. What should this keyword be replaced with?

    Thanks.

  20. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Up to now all WP themes worked fine and some plugins did not work well together. I can understand that and this is the reason why I liked blogging with WordPress.

    Not true, the 2.1 upgrade broke a lot of themes, as well as plugins.

    So now I do not understand why the database broke down in my own blog, this upgrade round. I don't know if it's the theme or anything else...

    And nobody can tell you that for certain either. We're not you, we don't have access to your site and setup. It might be a plugin, it might be the theme, but I cannot tell you because I'm not actually there, looking at your code.

    P.S. even when I use a 2.3 ready theme (for example Silverlight) the database keeps broken...

    Then maybe, just maybe, you've got an incompatible plugin? You know that you're supposed to disable all plugins before an upgrade, right? Well, now you know why.

  21. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    However, in 2.3 Categories no longer exist. What should this keyword be replaced with?

    Categories still exist in 2.3. So it's hard to know what you're talking about. Your CSS doesn't have anything to do with the database.

  22. George
    Member
    Posted 6 years ago #

    Otto, I dropped all tables in MyPHP. Uploaded the backed-up database. Then re-run upgrade.php, and now voila everything seems fixed. All plugins were disabled, it must have been the conversion of the database. So glad I made a back up!

  23. AffinityEnterprises
    Member
    Posted 6 years ago #

    http://deepthoughts.affinityenterprises.com/

    Deep Thoughts Categories no longer has the background formatting the other widgets have. I was instructed to go into "styles.css" and make sure I have #categories in the appropriate places.

    /*-------SIDEBAR---------*/

    #sidebar {
    font-size:.9em;
    }

    #meta,
    #categories,
    #pages,
    #yammyamm-menu,
    #recent-posts,
    #recent-comments,
    #peters-date-countdown,
    #calendar,
    #scrobbler,
    #links,
    #text-1,
    #text-2,
    #linkcat-5,
    #archives,
    #linkcat-4,
    #linkcat-11,
    #google-search,
    #front-page-login,
    #rss-1,
    #rss-2,
    #dthoughts
    {
    background: #eee url(images/sideboxbg.gif) top left repeat-x;
    padding: 25x;
    margin: 5px;
    border: 1px solid #ddd;
    }

    However, #categories doesn't seem to be working.

  24. jollymoon
    Member
    Posted 6 years ago #

    Greetings: Wow, a lot of serious dedicated users got upset. what do you expect for free!

    All we did to get rid of the errors was in Arnee's post...DISABLE ALL PLUGINS.

    We were lucky because we don't use that many plugins, SpotMilk,CaptCha!,Kaccordion Multipack...

    We Forgot to disable all plugins on the upgrade yesterday, but after trying to post and getting the errors like Arnee said, we went back and disabled the ULTIMATE TAG WARRIOR, SIMPLE TAGS, and WP-SHORTSTAT...

    Yeah!! no more errors...

    Hope this helps. The DATABase error is not in the theme but in the plugins mentioned.

  25. Ferdinand
    Member
    Posted 6 years ago #

    In may case the MyDashboard plugin cause the database error. Since it's gone everything is working fine again.

  26. mhdhallak
    Member
    Posted 6 years ago #

    I'm getting this error from the Popularity Contest plugin. Hope the author upgrades it as soon as possible.

  27. Sparrowhawk
    Member
    Posted 6 years ago #

    I received the WordPress database error in both the CopyBlogger and CutLine Themes.

    The cause was the SimpleTagging Plugin, version 1.6.8.1 which is supposed to be compatible with WordPress 2.3.

    I de-activated the plugin, error stopped, however now I don't have any of my tags.

    My page tabs don't work either now, 404 error, but I figure that may be something to do with the themes.

  28. doc_holiday
    Member
    Posted 6 years ago #

    I was not aware that SimpleTagging would work with 2.3

    http://trac.herewithme.fr/project/simpletagging/wiki/Limits%2C%20Known%20Issues

  29. rexsky
    Member
    Posted 6 years ago #

    upgrade ,just now~~
    :)

  30. patjepayer
    Member
    Posted 6 years ago #

    Well, I got some error lines too for wp2cat... after depluggin all and activating one bye one the plugin Jerome's Keyword causes the problem

124

Topic Closed

This topic has been closed to new replies.

About this Topic