• we have one users tomas with id 21 and andrej with id 2186 and a ton of posts. if tomas is logged in and visits the archive of andrej’s posts there are none and we get an sql 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 '86 OR (wp_term_taxonomy.taxonomy = 'author' AND wp_term_taxonomy.term_id = '3716' at line 1 pre po?iadavku SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships AS tr1 ON (wp_posts.ID = tr1.object_id) LEFT JOIN wp_term_taxonomy ON ( tr1.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id ) WHERE 1=1 AND ((wp_term_taxonomy.taxonomy = 'author' AND wp_term_taxonomy.term_id = '46'86 OR (wp_term_taxonomy.taxonomy = 'author' AND wp_term_taxonomy.term_id = '3716'))) AND wp_posts.post_type IN ('post', 'dn_blog') AND (wp_posts.post_status = 'publish' OR wp_term_taxonomy.taxonomy = 'author' AND wp_term_taxonomy.term_id = '46' AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID HAVING MAX( IF ( wp_term_taxonomy.taxonomy = 'author', IF ( wp_term_taxonomy.term_id = '3716' OR wp_term_taxonomy.term_id = '46',2,1 ),0 ) ) <> 1 ORDER BY wp_posts.post_date DESC LIMIT 0, 30 vykonanú require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    with this part being the problem:

    AND wp_term_taxonomy.term_id = '46'86 OR

    yes, the quotes are like this in the sql query. im blaming the regexps in function posts_where_filter in co-authors-plus/co-authors-plus.php, but iam not quite sure what they are doing so im not up to provide a fix.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘RegExp in plugin creates syntax errors in sql queries’ is closed to new replies.