• I am getting that annoying “Not Found” error when trying to show a category page. No, it is not the Permalinks – I tried everything.
    Any help would be great.

    wp-db.php L 1053 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 SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id = 54

    I wrote the queries to an external file and they do not seem truncated like the above one. This is what I see. The debugger was enabled and I am getting the following in query.php around lines 2642 and 2699 for one page load of a categor ypage.

    ----- query.php : 2642
    	$where:  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
    ----- query.php : 2642
    SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10.
    ----- query.php L 2699
    QUERY:
    	SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
    
    ----- query.php : 2642
    	where:  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')
    ----- query.php : 2642
    SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 5.
    ----- query.php L 2699
    QUERY:
    	SELECT   wp_posts.ID FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 5
    
    ----- query.php : 2642
    	where:  AND wp_posts.ID IN (183) AND wp_posts.post_type = 'nav_menu_item' AND (wp_posts.post_status = 'publish')
    ----- query.php : 2642
    SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.ID IN (183) AND wp_posts.post_type = 'nav_menu_item' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.menu_order ASC .
    ----- query.php : 2642
    	where:  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
    ----- query.php : 2642
    SELECT SQL_CALC_FOUND_ROWS  wp_posts.* FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10.
    ----- query.php L 2699
    QUERY:
    	SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1  AND ( wp_term_relationships.term_taxonomy_id IN (54) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10
    
    ----- query.php : 2642
    	where:  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')
    ----- query.php : 2642
    SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 5.
    ----- query.php L 2699
    QUERY:
    	SELECT   wp_posts.ID FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC LIMIT 0, 5
    
    ----- query.php : 2642
    	where:  AND wp_posts.ID IN (183) AND wp_posts.post_type = 'nav_menu_item' AND (wp_posts.post_status = 'publish')
    ----- query.php : 2642
    SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.ID IN (183) AND wp_posts.post_type = 'nav_menu_item' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.menu_order ASC .

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try:
    – switching to the default theme by renaming your current theme’s folder inside wp-content/themes and adding “-old” to the end of the folder name using FTP or whatever file management application your host provides.

    resetting the plugins folder by FTP or phpMyAdmin.

    – re-uploading all files & folders – except the wp-content folder and the wp-config.php & root .htaccess files – from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

    – running the upgrade manually via wp-admin/upgrade.php

    Thread Starter Alta

    (@shellardee)

    Switching theme doesn’t help.
    Resetting plugins doesn’t fix it.
    Uploaded everything except what you said doesn’t work.

    The debugger gave a MYSQL error.
    THE ERROR RETURNED WAS
    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 SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id = 54

    Thread Starter Alta

    (@shellardee)

    Oh – and I manually upgraded and that didn’t work.
    How can I do a fresh install and keep the current posts and users?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category Not Found – Just Upgraded – MYSQL Error’ is closed to new replies.