Forums

Wordpress database error with categories after upgrade to 1.5.2 (2 posts)

  1. luken7
    Member
    Posted 4 years ago #

    I get the following error in the categories section on my page:
    WordPress database error: [You have an error in your SQL syntax near 'name' at line 5]
    SELECT cat_ID, cat_name, category_nicename, category_description, category_parent FROM wp_categories WHERE cat_ID > 0 ORDER BY cat_All name

    So I go into webmin and execute this exact syntax and get the same error. But if I change the last three words from "cat_All name" to just "cat_name", it returns the categories

    Here's teh working syntax:
    SELECT cat_ID, cat_name, category_nicename, category_description, category_parent FROM wp_categories WHERE cat_ID > 0 ORDER BY cat_name

    Question, where in Wordpress can I change this SQL query? I suspect that it's built from the templates-functions-category.php page somehow.

    Any ideas? Thanks in advance

  2. luken7
    Member
    Posted 4 years ago #

    Followup, I've got a temporary workaround. On line 274 in the templates-functions-category.php file, I changed:

    "ORDER BY $sort_column $sort_order"
    to
    "ORDER BY cat_name"
    and it now works, but I don't want to leave it like that.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags