Forums

[Plugin: Yet Another Related Posts Plugin] MySQL Error (5 posts)

  1. sara3903
    Member
    Posted 5 months ago #

    I just upgraded to YARPP 3.0.5 and am using WP version 2.1.7. Now at the top of every post I get an error message:

    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 '-1' at line 1]
    SELECT SQL_CALC_FOUND_ROWS wp_posts.*, yarpp.score FROM wp_posts join wp_yarpp_related_cache as yarpp using (ID) WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') and post_date > date_sub(now(), interval 12 month) ORDER BY wp_posts.post_date DESC limit -1

    ??

  2. mitchoyoshitaka
    Member
    Posted 5 months ago #

    @sara3903 please note that YARPP requires WP version 2.3 or higher.

  3. sdhunt
    Member
    Posted 4 months ago #

    I'm getting a similar error in my search results rss feed.

    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 'post') AND post_type != 'revision'  ORDER BY yarpp.score DESC  limit 3' at line 1]
    
    		 SELECT DISTINCT SQL_CALC_FOUND_ROWS  wp_posts.*, yarpp.score FROM wp_posts  LEFT JOIN wp_term_relationships AS trel ON (wp_posts.ID = trel.object_id) LEFT JOIN wp_term_taxonomy AS ttax ON (  ( ttax.taxonomy = 'category' OR ttax.taxonomy = 'post_tag' )  AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_terms AS tter ON (ttax.term_id = tter.term_id)  LEFT JOIN wp_postmeta AS m ON (wp_posts.ID = m.post_id)  LEFT JOIN wp_users AS u ON (wp_posts.post_author = u.ID)  join wp_yarpp_related_cache as yarpp using (ID) WHERE 1=1 AND ( yarpp.score > 5 and yarpp.reference_ID = 2930 AND wp_posts.post_type = 'post OR ((tter.name LIKE '%malkin%'))  OR ((m.meta_value LIKE '%malkin%'))  OR ((wp_posts.post_excerpt LIKE '%malkin%')) )ND yarpp.score > 5 and yarpp.reference_ID = 2930 AND wp_posts.post_type = 'post') AND post_type != 'revision'  ORDER BY yarpp.score DESC  limit 3

    So far I've only encountered the error when searching for the word "malkin" strangely enough. I'm running WP 2.8.2 and YARPP 3.0.7.

    Any thoughts?
    Thanks

  4. mitchoyoshitaka
    Member
    Posted 3 months ago #

    @sdhunt - hmm... Looking at that error, it's very inconclusive as to why this is happening...

    By the way, are you trying to run this query directly using a certain keyword? That use of yarpp_sql is not supported.

  5. ryan-isra
    Member
    Posted 1 month ago #

    If you have SEO Pager plugin installed, disable auto implementation and add code to your template manually.
    http://wordpress.org/support/topic/267966

Reply

You must log in to post.

About this Topic