WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Sparrowhawk
    Member
    Posted 6 years ago #

    "I was not aware that SimpleTagging would work with 2.3"

    SimpleTagging version 1.6.8.1, was offered as a new upgrade for 2.3 on my plugin page, which is why I installed it.

    Apprantly I should have taken a look at the compatibility page instead and saved myself a lot of work. ;-)

  2. punkoblog
    Member
    Posted 6 years ago #

    I am getting this error. However, I am now unable to deactivate any plugins from admin. AND, I am unable to delete any of the plugin folders, or even the Plugins folder from my server now. When I try I get an error saying I do not have the permissions. Wow, I am stupified.

  3. JoyceD
    Member
    Posted 6 years ago #

    I found out that Custom Query String is causing my wp_categories errors. I'd really like to continue using it but Matt Read no longer supports it. Would anyone know what to change to make it work with 2.3?

  4. Keilya
    Member
    Posted 6 years ago #

    I found out that Custom Query String is causing my wp_categories errors. I'd really like to continue using it but Matt Read no longer supports it. Would anyone know what to change to make it work with 2.3?

    I really liked that plugin thing...really nifty. I'm still running it though. Just that you are not able to specify the arrangement of posts within specific categories. However you can still give general rules to all the categories and archives as a whole in general.

    Of course if anyone do have a substitute for this plugin, do post it!

    Lastly, I've done some searching around the plugin database. There seems to be some plugins similar to this. Where it allows you to arrange by alphabatical order. Another one was even more specific, allowing you to order the exact sequence of the posts. But I found it to be not what I needed as it's far too specific, tedious and requires too much input on my part. Anything close to Matt Read's Custom Query String is much appreciated!

  5. MichaelH
    Member
    Posted 6 years ago #

  6. lynnlovestennis
    Member
    Posted 6 years ago #

    This could not get any better. I was forced to upgrade from 2.2 to 2.3 yesterday after HostGator decided to randomly shut down my site for abuse claiming that I was producing SQL queries (ie, server load) that they could not explain.

    I've been getting the "'wp_categories' doesn't exist" message since the upgrade.

    In trying to ascertain what plugin, if any, was causing the problem, I tried out the groovey new 'categories to tags' function, which then deleted all my categories -- save, of course, for the default one.

    So now I have table errors as well as no categories.

    How exciting! Can it get better?

  7. betobeto
    Member
    Posted 6 years ago #

    Hi all,

    I've been using a customized version of the Yet Another Photoblog plugin, which has also been hit by the 2.3 post2cat gotcha. The author's forum is regrettably having problems at this moment so I'm giving this place a try. :)

    As part of my customizations I've got a Query variable that looks like this (and I'm sure is what is causing the choking at this time):

    $query = "SELECT p.* FROM $wpdb->post2cat p2c LEFT JOIN $wpdb->posts p ON p2c.post_id = p.ID WHERE p2c.category_id = $categoryId AND p.post_status = 'publish' ORDER BY post_date DESC" . $limit;

    Since I don't speak MySQL :P, how should this string be built so I can stop getting the "table not found" message?

    Thanks in advance for any help.

  8. isometric
    Member
    Posted 6 years ago #

    I'm also getting a similar error in regards to Posting Comments, Posts and removing Comments/Posts.
    Here is what I'm getting :

    WordPress database error: [Table 'web6_db1.wp_post2cat' doesn't exist]
    SELECT YEAR(post_date) AS year, MONTH(post_date) AS month, category_id FROM wp_posts INNER JOIN wp_post2cat ON (wp_posts.ID = wp_post2cat.post_id) WHERE post_date > 0 AND category_id <> 0 AND ID = 95 ORDER By post_date DESC

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/web6/web/wp-includes/wp-db.php:160) in /var/www/web6/web/wp-includes/pluggable.php on line 390

    I have already imported the old SQL backup I made and re-ran the upgrade.php with all Plug-ins disabled but still no luck. :(

    So I'm assuming it has something to do with my Theme?
    I am using iTheme 1.1...

    This really sucks :(

  9. monadfm
    Member
    Posted 6 years ago #

    I upgraded to 2.3 and my wp_categories tables disappeared from my database. All I did was replace the tables with my backup and ran upgrade again and it is working. Wanted to let you know in case this will help anyone.

  10. Stephanie Leary
    Member
    Posted 6 years ago #

    I'm getting the error simply by using query_posts in my sidebar to get recent posts from a specific category:

    <?php query_posts('cat=43&showposts=10');
     while (have_posts()) : the_post();?>
    <div class="foo">
    <?php the_content(); ?>
    <a href="<?php the_permalink(); ?>#comments"
    class="commentlink"></a></div>
    <?php endwhile; ?>

    Suggestions welcome.

    ETA: It seems that cat=43 needs to become term=43, but the query no longer works as expected. It's pulling up the last 10 posts regardless of their categories.

  11. producte
    Member
    Posted 6 years ago #

    Well, for me, the only temporary fix I've found is disabling this plugin:

    Extended Live Archives 0.10beta-r16

    Implements a dynamic archive, inspired by Binary Bonsai and the original Super Archives by Jonas Rabbe. Visit the ELA option panel to initialize the plugin. By Arnaud Froment (http://www.sonsofskadi.net/).

    Then, it works perfectly. Activating it, the errors comes back. A pitty, it's a cool plugin for archives.

  12. Doug Smith
    Member
    Posted 6 years ago #

    I put together a plugin that will scan through other plugins and themes to look for potential conflicts with WordPress 2.3. It may be of help to others in their upgrade process. I recommend running it before upgrading to identify possible problems, but it can also be used after the fact to help find the source of errors.

    You can find it here: Upgrade Preflight Check.

  13. ibrahimcesar
    Member
    Posted 6 years ago #

    Thanks douglsmith! Very helpful! Work in 2 blogs, on another one I disable a certain plugin (WordPress Automatic Upgrade) and my Admin turn blank! I just got blank pages...I cannot acess my admin pages! Someone can help me?

    Thanks!

  14. Drewminstry
    Member
    Posted 6 years ago #

    Douglsmith thats totally brilliant!
    I just wish I'd had that before I decided to upgrade yesterday - I'd vote that your plugin should be added to all future releases of WP. I'd like to know what's likely to be broken by an upgrade before I run it!

    OK. so the issue is fixable either by changing plug-ins or themes.
    And reading above, I get the impression that the code for the default theme has changed 2.2 to 2.3.
    Can anyone point me to a listing of those changes?
    I've got a theme that is a customised version of default made for 2.2, and I'd like to check it through, as it's likely that it is my problem. and I'd like to manually replicate any changes to default theme.

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

    sillybean: No, the "cat" variable should continue to work just fine for query_posts. If you're getting any sort of category error from that, then you're either using a plugin that modifies the query, or you failed to update all the files in wp-includes.

    About a third of the complaints I see in here seem to be from failing to update *all* the WordPress files. Make sure that you upload ALL the files, people.

    Also, disable all plugins before upgrading. Then re-enable them, one at a time. The changes in 2.3 are large, so the odds something will break your plugins is high. Look for upgraded or alternative plugins when you find one that breaks something.

  16. isometric
    Member
    Posted 6 years ago #

    Producte is right.
    I also disabled the Extended Live Archives yesturday and everything seems to be working fine now.

  17. buzz
    Member
    Posted 6 years ago #

    I had this error with no plugins activated. Turns out I had uploaded the wrong wp-config.php file.

  18. americasroof
    Member
    Posted 6 years ago #

    After considerable drama I used phamyadmin to add the table back (it was not picky about field names or descriptions). That solved the problem.

  19. Chris_K
    Member
    Posted 6 years ago #

    That solved the problem

    Well, it "masked" the problem. It'll be back to bite you unless you figure out which theme or plugin you're using needs to be upgraded.

  20. subwayblogger
    Member
    Posted 6 years ago #

    NOTICE Google sitemap plugin does not automatically get flagged as needing to be upgraded. I had a pre 3.0 version, and the new plugin checker didnt know that there was a new one.

    As soon as I upgraded to 3.0, everything worked like butter.

  21. Keilya
    Member
    Posted 6 years ago #

    joyce and fantasy..

    http://wordpress.org/support/topic/135636?replies=5

    Much love and thanks. ^_^

  22. Stephanie Leary
    Member
    Posted 6 years ago #

    Otto42: well, that marks the first time Transmit has failed me on synchronization, but re-uploading wp-includes did indeed fix the problem. Thanks.

  23. z1zzy
    Member
    Posted 6 years ago #

    I updated with Dreamhost's one click install, and now I'm getting this at the very top of my page, and also in the sidebar where the categories should be:

    WordPress database error: [Table 'megatonikwp1.wp_terms' doesn't exist]
    SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag') AND tr.object_id IN (313, 312, 309, 306, 303, 301, 299, 298, 296, 295, 294, 293, 291, 284, 283) ORDER BY t.name ASC

    And this where categories should show up below posts:

    WordPress database error: [Table 'megatonikwp1.wp_terms' doesn't exist]
    SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (313) ORDER BY t.name ASC

    Plus, all my categories got deleted, and I can't add any new ones.

    I really need to get this fixed...can any one help, and if possible tell me how I can make my theme compatible?

  24. demodulated
    Member
    Posted 6 years ago #

    Thank goodness I knew about the forums at wordpress.org. I was THIS CLOSE (holds fingers close together) to looking for a new blog platform after getting this database error after upgrading. Luckily the forums advised me to toggle my theme and plugins and I isolated the problem as an old Google Sitemaps plugin.

    I was quite frustrated with the installation instructions. It's a good thing I'd upgraded so many times before so the absence in the quick install guide of a recommendation to make backups was conspicuous! Why are people not recommended to make backups?? Good thing I did!!!!

    I'm also annoyed that the quick install guide didn't advise me that some plugins are not compatible with WP2.3 so I had no idea that they could be the problem. Toggling plugins one by one revealed the issue and I was up and running in no time - after hours and hours of troubleshooting.

    Great release but terrible documentation. The poor docs nearly made me ditch WordPress forever. If I did this my first post would be advising everyone to stay far away from WordPress.

    For shame. This was a very common problem with a very easy solution, and if I didn't think to look at the forums I never would have fixed it.

  25. jacktan
    Member
    Posted 6 years ago #

    erm, can someone please explain to me this in layman terms?

    Ultimate Tag Warrior 3.14159265 Possibly incompatible: old category table.1

    how do i fix it?

  26. mdi
    Member
    Posted 6 years ago #

    @demodulated

    maybe it's because you »upgraded so many times« and because you're such a pro, that you don't read instructions... maybe it's because you found WordPress somewhere else...

    We’ve got information on installation and upgrading if you need it.

    Step 0: Before You Get Started

    * Just in case something goes wrong, it never hurts to have a backup. We have extensive instructions to help you out.

    what else do you need?

  27. magnetbox
    Member
    Posted 6 years ago #

    Here's how I fixed it.

    Previous code:

    <?php
    	$query = "SELECT cat_ID, cat_name, category_nicename, category_description, category_parent, category_count FROM $wpdb->categories ORDER BY cat_name";
    	$categories = $wpdb->get_results($query);
    	foreach ( $categories as $category ) {
    		echo("<div class=\"cat_num\">".intval($category->category_count)."</div><div class=\"cat_name\"><a href=\"".get_category_link($category->cat_ID)."\">".$category->category_nicename."</a></div>");
    	}
    	?>

    New code:

    <?php
    	$query = "SELECT * FROM $wpdb->term_taxonomy JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) WHERE $wpdb->term_taxonomy.taxonomy = 'category' ";
    	$categories = $wpdb->get_results($query);
    	foreach ( $categories as $category ) {
    		echo("<div class=\"cat_num\">".intval($category->count)."</div><div class=\"cat_name\"><a href=\"".get_category_link($category->term_id)."\">".$category->name."</a></div>");
    	}
    	?>

    Basically, instead of grabbing the fields from the categories table, you grab anything that's a category in the taxonomy table and look up the title in the terms table. I'm sure there's an even smarter or more proper way of doing it (such as using the relationships lookup table) but for my simple little category link list it did the trick.

  28. Pinyin
    Member
    Posted 6 years ago #

    I'm having similar woes. Here's what I've been getting lots and lots of since upgrading to 2.3:
    ---
    WordPress database error: [Table 'py.wp_post2cat' doesn't exist]
    SELECT post_id, category_id FROM wp_post2cat WHERE post_id IN (***)
    ---
    [I've substituted *** for the numbers that appear in parentheses, as they are different in each post and appear to be the post number.]

    I tried disabling all plugins. This made no difference. (I had only a few basic ones anyway.)

    I tried changing from my own custom theme to other themes. The problem didn't change. (The only thing I had altered in my own theme was the CSS. I don't know enough about PHP to mess with that.)

    Searches of my files didn't turn up the code magnetbox posted, so I couldn't change that.

    douglsmith's Preflight plugin didn't turn up anything in need of fixing.

    What *does* improve things temporarily is if I run the database update script (wp-admin/upgrade.php). But, oddly enough, the fix doesn't last; the problems always return.

    I've cleared the cache in my browser. I've tried different browsers (Opera, Firefox, IE). No difference.

    In case it matters, this blog is hosted on Dreamhost. WordPress was installed through the Dreamhost panel and has been upgraded through that as well.

    Any useful advice would be gratefully received. Thanks.

  29. orasid
    Member
    Posted 6 years ago #

    I deactivated Jerome Keyword's Plugin. Popularity Contest latest plugin "works" now for 2.3

  30. orasid
    Member
    Posted 6 years ago #

    It's kinda weird. If I activate Jerome Keyword's Plugin, the infamous wp_post2cat complains however, on other pages such as archive, category, it didn't show.

    I just lost my tags. Sadness.

Topic Closed

This topic has been closed to new replies.

About this Topic