Title: [Plugin: Yet Another Related Posts Plugin] SQL Syntax Error
Last modified: August 19, 2016

---

# [Plugin: Yet Another Related Posts Plugin] SQL Syntax Error

 *  [mfeldstein](https://wordpress.org/support/users/mfeldstein/)
 * (@mfeldstein)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/)
 * I’m pretty excited about the features of your plugin, but when I install it and
   try to view a post, I get the following 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 ‘and catscore >= 1 and tagscore >= 1 order by post_date DESC limit
   > 4’ at line 21]
   >  SELECT *, (bodyscore * 1 + titlescore * 3 + tagscore * 1 + 
   > catscore * 1) AS score from ( select ID, post_title, post_date, post_content,(
   > MATCH (post_content) AGAINST (‘students learning lectures lecture student environment
   > boring academics article internet experience engaging adams professor passive
   > education research wireless teacher academic’)) as bodyscore, (MATCH (post_title)
   > AGAINST (‘syndrome street sesame’)) as titlescore, ifnull(catscore,0) as catscore,
   > ifnull(tagscore,0) as tagscore from wp_posts left join ( select count(*) as
   > block, object_id from wp_term_relationships natural join wp_term_taxonomy natural
   > join wp_terms where wp_terms.term_id in (4) group by object_id ) as poolblock
   > on (wp_posts.ID = poolblock.object_id) left join ( select count(*) as tagscore,
   > object_id from wp_term_relationships natural join wp_term_taxonomy where wp_term_taxonomy.
   > taxonomy = ‘post_tag’ and wp_term_taxonomy.term_taxonomy_id in (select term_taxonomy_id
   > from wp_term_relationships where object_id = ‘449’) group by object_id ) as
   > matchtags on (wp_posts.ID = matchtags.object_id) left join ( select count(*)
   > as catscore, object_id from wp_term_relationships natural join wp_term_taxonomy
   > where wp_term_taxonomy.taxonomy = ‘category’ and wp_term_taxonomy.term_taxonomy_id
   > in (select term_taxonomy_id from wp_term_relationships where object_id = ‘449’)
   > group by object_id ) as matchcats on (wp_posts.ID = matchcats.object_id) where((
   > post_status IN ( ‘publish’, ‘static’ ) && ID != ‘449’) and post_password =”
   > and post_type IN (‘post’) and block IS NULL ) ) as rawscores where (bodyscore*
   > 1 + titlescore * 3 + tagscore * 1 + catscore * 1) >= and catscore >= 1 and 
   > tagscore >= 1 order by post_date DESC limit 4`
 * Can you help me out? I’m afraid that I don’t know much about my host’s setup 
   in terms of MySQL versions, although I can try to do a little research if that’s
   called for.
 * Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/#post-846959)
 * Hi [@mfeldstein](https://wordpress.org/support/users/mfeldstein/) — I have a 
   new version of the algorithm which may solve your issue… I would greatly appreciate
   it if you could beta it. Please [email me](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/mitcho@mitcho.com?yarpp+beta)
   and I will send you the beta.
 * [mitcho](http://mitcho.com)
 *  [terriz](https://wordpress.org/support/users/terriz/)
 * (@terriz)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/#post-847090)
 * Hi,
    I have an error similar to this. I’m using WP 2.2.1. When I activate the
   plugin, at the top of the options page I see this 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 ' name from natural join where .taxonomy = 'category'' at line 1]
       select .term_id, name from natural join where .taxonomy = 'category'
       ```
   
 * At the beginning of my posts is a much longer version of this error message. 
   I’ve disabled the plugin for now…
 * Thanks in advance
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/#post-847091)
 * [@terriz](https://wordpress.org/support/users/terriz/) – YARPP only supports 
   WP versions 2.2 and above, as is stated on the plugin’s page. Sorry about that.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Yet Another Related Posts Plugin] SQL Syntax Error’ is closed
to new replies.

 * 3 replies
 * 3 participants
 * Last reply from: [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-sql-syntax-error/#post-847091)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
