• Hello, I have browsed through the forums repeatedly trying to figure out what is wrong with this site. I upgraded WP to 2.1 and now I get this message in the sidebar:

    [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 ” at line 1]
    SELECT cat_id, cat_name FROM

    All the other templates work fine. Can someone please twll mw how to fix this?

Viewing 3 replies - 16 through 18 (of 18 total)
  • I found how to correct this problem, you just need to replace 2 lines on the file functions.php on the Freshy theme folder.

    1-open the file on any text editor
    locate for the function yy_widget_links tha should be the first function of the file and in this function replace 2 lines.

    replace:
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    for:
    $link_cats = $wpdb->get_results("SELECT DISTINCT cat_name, category_id FROM $wpdb->categories INNER JOIN $wpdb->link2cat ON $wpdb->categories.cat_id=$wpdb->link2cat.category_id");

    and replace:
    wp_get_links($link_cat->cat_id);
    for:
    wp_get_links('category='.$link_cat->category_id.'&before=<li>&after=</li>&show_description=0&limit=100');

    And now you can use the widget, as i`m using it again on my blog.

    Bless you, Tales! Your fixes resolved the problem. Thanks!

    STill not working with what tales said, I’m still getting the error:

    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 ” at line 1]

    SELECT cat_id, cat_name FROM

    Under “Links” ??

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘WordPress database error:’ is closed to new replies.