WordPress.org

Ready to get started?Download WordPress

Forums

categories_nicename ?? and comment_approved (3 posts)

  1. peachCobbler
    Member
    Posted 10 years ago #

    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.

  2. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    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 (
    rel_id INT NOT NULL AUTO_INCREMENT ,
    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.
    Ryan

  3. peachCobbler
    Member
    Posted 10 years ago #

    Thanks Ryan, problem solved!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.