• Resolved fnorte

    (@fnorte)


    Hi all,

    I try to find and don’t have a answer until now.
    In my wordpress installed in a linux server with PHP 5.1.6 and MySQL 4.1.21 I have a problem with the Categories.

    In the admin manager (Manager >> Comments) nothing is showing, but when I will write a post, the Categories is in there. When I create a new category, that is showed in the list, and add to the database, but only by the jscript. If I load this page again, the categories list still empty.

    In the sidebar when I try to list the categories using the WIDGETS I get this error:

    Warning: join() [function.join]: Bad arguments. in /home/osimorta/public_html/fnorte/wp-includes/category.php on line 290
    
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND post_type = 'post' AND post_status = 'publish'' at line 1]
    SELECT post_id, category_id FROM wp_post2cat LEFT JOIN wp_posts ON post_id = ID WHERE category_id IN () AND post_type = 'post' AND post_status = 'publish'

    The code create by the WIDGETS is:
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>

    The documentation said that this funciton (wp_list_cats) is deprecated and I need to use other (wp_list_categories). But the result is the same.

    I’d realized that the links to the categories page, in the categories listed in a post, is blank too (?cat=*nothing*).

    I was using the 2.1 version, and think that 2.2 will solved the problem, but doesn’t.

    Anyone can help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • With 2.2.1 (and 2.2) you need to deactivate and delete the Sidebar Widgets plugin.

    Then use the built-in Category Widget which uses the template tag, wp_list_categories().

    Thread Starter fnorte

    (@fnorte)

    suspecting the problem is in the database, I’d installed a local version to COMPARE the databases.

    The problem is solved.

    The error was in the wp_categories table, for some reason (maybe a backup recovery) the field name was changed from cat_ID to cat_id. This case difference was generating the error.

    Thanks to MichaelH to trying help, and I hope to the help others who might be get the same problem.

    Take care with database backups. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Categories don’t list and have MySQL error’ is closed to new replies.