Title: Error in SQL Syntax
Last modified: October 15, 2023

---

# Error in SQL Syntax

 *  Resolved [wildewebmarketing](https://wordpress.org/support/users/wildewebmarketing/)
 * (@wildewebmarketing)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-17/)
 * Recently started getting this error repeatedly in debug logs:
 * [15-Oct-2023 06:43:52 UTC] WordPress database error You have an error in your
   SQL syntax; check the manual that corresponds to your MariaDB server version 
   for the right syntax to use near ‘) AND 1=1 AND ((s.source = ‘post.download’ 
   AND (s.attribute IN (‘title’,’cont…’ at line 4 for query SELECT SQL_CALC_FOUND_ROWS
   s.id,s.source,s.site,SUM(relevance) AS relevance
   FROM (SELECT s.id,s.source,s.
   site,s.attribute,((SUM(s.occurrences) * CASE WHEN ( (s.source = ‘post.download’
   AND (s.attribute IN (‘title’))) ) THEN 300 WHEN ( (s.source = ‘post.download’
   AND (s.attribute IN (‘content’,’taxonomy.download_tag’))) ) THEN 150 WHEN ( (
   s.source = ‘post.download’ AND (s.attribute IN (‘taxonomy.download_category’))))
   THEN 1 END) ) AS relevanceFROM plg_searchwp_index s LEFT JOIN plg_posts s1 ON(
   s1.ID = s.id)WHERE 1=1 AND 1=1 AND s.token IN () AND 1=1 AND ((s.source = ‘post.
   download’ AND (s.attribute IN (‘title’,’content’,’taxonomy.download_category’,’
   taxonomy.download_tag’)) AND ( ( `s1`.`post_type` = ‘download’ ) AND ( `s1`.`
   post_status` IN ( ‘publish’, ‘acf-disabled’ ) ) AND ( `s1`.`ID` NOT IN ( 98132,
   98091, 98079, 74414, 74252, 73017, 61909, 61867, 61814, 16682, 16681, 16680, 
   14904, 13987, 13316, 11998, 11997, 9021, 9018, 8916, 6707, 6708, 6709, 6710, 
   6704, 6705, 6706, 6703, 6696, 5503, 5385, 5316, 5314, 5217, 4944, 4817, 4806,
   4610, 4611, 4612, 4613, 4614, 4615, 4129, 3636, 3639, 3447, 3108, 2977, 1200,
   1129, 296, 100 ) ) )))GROUP BY s.site,s.source,s.attribute,s.id) AS sLEFT JOIN
   plg_posts s1 ON (s1.ID = s.id)WHERE 1=1 AND (SUBSTRING(s.source, 1, 5) != ‘post.’
   OR (SUBSTRING(s.source, 1, 5) = ‘post.’ AND s.id != ‘0’))GROUP BY s.site, s.source,
   s.idHAVING relevance > 0ORDER BY relevance DESCLIMIT 0, 50 made by do_action(‘
   wp_ajax_nopriv_searchwp_live_search’), WP_Hook->do_action, WP_Hook->apply_filters,
   SearchWP_Live_Search_Client->search, SearchWP_Live_Search_Client->search_get_args,
   SearchWP_Live_Search_Client->search_get_args_searchwp, SearchWP_Live_Search_Client-
   >search_get_args_post__in_searchwp, SearchWP_Live_Search_Client->search_get_args_post__in_searchwp_v4,
   SWP_Query->__construct, SWP_Query->get_search_results, SearchWP\Query->__construct,
   SearchWP\Query->run, SearchWP\Query->find_results, SearchWP\Query->execute

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

 *  Plugin Support [Karan](https://wordpress.org/support/users/kjswp/)
 * (@kjswp)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-17/#post-17135609)
 * Hi [@wildewebmarketing](https://wordpress.org/support/users/wildewebmarketing/),
   
   Based on the SQL information, the error is being caused due to search query of
   main SearchWP plugin. If you are using an old version of SearchWP then can you
   try updating the plugin to latest version and see if it resolves the error?If
   that doesn’t work then please raise a support ticket from the plugins menu. We
   will then help from there.
 *  Plugin Support [Karan](https://wordpress.org/support/users/kjswp/)
 * (@kjswp)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-17/#post-17511558)
 * Hi ,
 * We haven’t heard back from you since our last reply, so I’m going to go ahead
   and close this thread for now. But if you’d like us to assist further, please
   feel welcome to continue the conversation.
 * Thanks!

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

The topic ‘Error in SQL Syntax’ is closed to new replies.

 * ![](https://ps.w.org/searchwp-live-ajax-search/assets/icon-256x256.png?rev=3119393)
 * [SearchWP Live Ajax Search](https://wordpress.org/plugins/searchwp-live-ajax-search/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/searchwp-live-ajax-search/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/searchwp-live-ajax-search/)
 * [Active Topics](https://wordpress.org/support/plugin/searchwp-live-ajax-search/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/searchwp-live-ajax-search/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/searchwp-live-ajax-search/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Karan](https://wordpress.org/support/users/kjswp/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/error-in-sql-syntax-17/#post-17511558)
 * Status: resolved