Support » Installing WordPress » Upgrade Database Problem Only With Categories

  • Hi there,

    Relatively new user of WP just upgraded for the first time ever from 2.02 to 2.2 and I’m having an issue with categories. They’re displaying but I can’t add any more. Additionally, I’m getting an error message both on the site and in the category field when I create a post.

    Here’s the message displayed on the site:

    WordPress database error: [Unknown column ‘link_count’ in ‘where clause’]
    SELECT * FROM wp_categories WHERE cat_ID > 0 AND link_count > 0 ORDER BY cat_name ASC

    The site is at and if you can help me I’d greatly appreciate it.

Viewing 9 replies - 1 through 9 (of 9 total)
  • I suspect your theme needs updating. I vaguely remember some category functions have changed names or arguments since 2.0

    I am also having problems with categories after upgrading to 2.2

    The categories on my existing blogs show up correctly but if I try to post a new article or edit an existing one the area on the right that should have the list of categories has an error message instead of the list.

    WordPress database error: [Unknown column ‘link_count’ in ‘where clause’]
    SELECT cat_ID FROM wp_categories WHERE category_parent = 0 AND ( link_count = 0 OR category_count != 0 OR ( link_count = 0 AND category_count = 0 ) ) ORDER BY category_count DESC

    This is similar to the error I got on my page where my blogroll used to be (have not resolved that one either though I think it is related to the old version of WP having multiple sets of links – not just blogroll)

    The categories on my page display correctly, it is just in the editor section that seems to have a problem.

    Makes me think your upgrade failed (or never happened).

    Might consider using phpMyAdmin on your wp_options table and set the database version db_version to 3441, then execute the upgrade.php again.

    Ok maybe this is what happened before – I did as you suggested changing the db_version and ran upgrade.php

    What I mistook the first time for processing notations were in fact error messages – What i saw at the bottom – that WP had installed successful made me think all was well, that the messages could have been for options that I did not have installed and there for were null messages.

    This time i went back to the top message and it said that I did not have authorization (I was signed is as admin)and one of the errors was it unsuccessfully trying to add a new column to the db which matches the error in the catagory list area.

    Now when I run the update.php it simply says no update needed. How do I get a successful install?

    If the update didn’t work after resetting the db_version value, I would consider dropping my current database tables and restoring the database from the backup you made before staring the upgrade.

    I seem to have tracked it down to the install and later phpmyadmin not proprly identifying the host name – the errors are either that it is using “localhost” which is not correct or using a var name like “DB_HOST()” instead.

    I looked through some of the CSS and php fils trying to locat the one with the login script. To no avail so far.

    Looks like you resolved your problem.

    Hey guys,

    I figured out the issue here thanks to a poster on my blog. There’s a few piece of code I had to replace in the database that I accessed via MyPHPadmin. It may be because Yahoo is my blog host.

    Here’s the step-by-step if you’re intersted thanks to WP user unplugged.

    Where am I going with this? I fixed my (Yahoo-based?) problem like this after going through the Codex (INCLUDING BACKING UP EVERYTHING!):
    1) Log into your Yahoo account
    2) Make sure you have phpMyAdmin installed. What is this? Don’t know if you have it installed? Click here.
    2) After you are sure it is installed, from the Web Hosting Control Panel go to the Manage tab
    3) Click File Manager
    4) Open the SQLadmin folder
    5) Click on index.php. This will open your SQL database login screen.
    6) Log in. You are now in the phpMyAdmin tool.
    7) Back up the database where your blog is. If you do not know how to do this, go here:
    8 After you have done this (or, like me, you were so mad you just didn’t care anymore) open your blog database by selecting the appropriate choice from the list on the left.
    9) You will see a table named wp_categories. Click on the little “structure” icon to the right of the table name.
    10) A list of table fields comes up. Great. Now what?
    11) Open up another browser window and go here. You will see a database description for wp_categories if you scroll down a bit.
    12) This list is a little longer than the one you see in your SQL database. We need to add the missing items.
    13) Under the list of fields in the database is a hard-to-see (for me, anyway) section that allows you to add fields. With the At End of Table button selected, click ‘Go’.
    14) You will now name the new field link_count, set the type to BIGINT, the length to 20, and the default value to 0. Save your changes.
    15) Do steps 13 and 14 with posts_private and links_private.
    16) Get out of the phpMyAdmin tool and check out your site. If there is still no change, change your theme to something else, and then back again. Sometimes I have to do that to get things to “take”.

    Like I said, I am not an expert in any of this but I stumbled upon this solution and it appears to work for me so far.

    Oh, lord, can someone please help me!

    This is EXACTLY my problem, and the direction are fantastic, except…

    When I get to step 8, instead of any of my database info being listed in phpMyAdmin, there’s my web address at the top of the screen on the left, a “Control Panel” link at the top right…

    and then VAST WHITE SPACE below it!!!

    This is driving me mad! I hate Yahoo with a passion!

    I would very much appreciate any help anyone can offer. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Upgrade Database Problem Only With Categories’ is closed to new replies.