Support » Fixing WordPress » categories_nicename ?? and comment_approved

  • peachCobbler


    I’ve just uploaded the CVS version and managed to install and log in fine. But I get these error mesgs when I view my site.
    I manually added the b2post2cat table at the very beginning, and then added the category_nicename field (as well as the category_id and post_id fields). I correctly guessed the various input attributes for category_id and post_id fields, but fell flat with the category_nicename bit. I’ve checked various sections under ‘Options’ to get clues, but no luck.
    [Column: ‘category_nicename’ in field list is ambiguous]
    SELECT category_id, cat_name, category_nicename, category_description FROM b2categories, b2post2cat WHERE b2post2cat.category_id = cat_ID AND b2post2cat.post_id = 26
    Unknown column ‘comment_approved’ in ‘where clause’]
    SELECT COUNT(*) FROM b2comments WHERE comment_post_ID = 26 AND comment_approved = ‘1’
    Can anyone offer some suggestions on what I should do?
    I’m a newbie at all this. Only started my personal website 3 December 🙂 Plain English would be very helpful.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ryan Boren


    WordPress Dev

    category_nicename does not belong in the post2cat table. It should be in the categories table only. upgrade-072-to-080.php should create post2cat for you, like such:
    CREATE TABLE b2post2cat (
    post_id INT NOT NULL ,
    category_id INT NOT NULL ,
    PRIMARY KEY ( rel_id ) ,
    INDEX ( post_id , category_id )
    Simply running upgrade-072-to-080.php should setup everything for you.
    BTW, category_nicename is just the cat_name run through sanitize_title(). sanitize_title() makes the category string lower case, removes special chars, and canonicalizes whitespace.



    Thanks Ryan, problem solved!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘categories_nicename ?? and comment_approved’ is closed to new replies.