Getting WordPress Database Error in SQL syntax with Empty Searches
-
Hi,
As per the title, I have checked the error log of my site and Im receiving the following error when a user performs an empty search.
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 (wp_11_posts.ID NOT IN ( 24,34,32 )) AND wp_11_posts.post_type IN ('pos' at line 1 for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_11_posts.* FROM wp_11_posts LEFT JOIN wp_11_term_relationships AS trel ON (wp_11_posts.ID = trel.object_id) LEFT JOIN wp_11_term_taxonomy AS ttax ON ( ( ttax.taxonomy = 'category' OR ttax.taxonomy = 'post_tag' OR ttax.taxonomy = 'post_format' OR ttax.taxonomy = 'tax_prac_areas' ) AND trel.term_taxonomy_id = ttax.term_taxonomy_id) LEFT JOIN wp_11_terms AS tter ON (ttax.term_id = tter.term_id) LEFT JOIN wp_11_postmeta AS m ON (wp_11_posts.ID = m.post_id) WHERE 1=1 AND ( ( ((())) AND (wp_11_posts.ID NOT IN ( 24,34,32 )) AND wp_11_posts.post_type IN ('post', 'page', 'attachment', 'csk_practice', 'csk_case_study', 'csk_testimonial') AND (wp_11_posts.post_status = 'publish' OR wp_11_posts.post_status = 'private')) AND post_type != 'revision') AND post_status != 'future' ORDER BY wp_11_posts.post_title LIKE '% %' DESC, wp_11_posts.post_date DESC LIMIT 0, 10 made by require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
Any advice would be great.
Cheers for putting together a great plugin.
Noel
- The topic ‘Getting WordPress Database Error in SQL syntax with Empty Searches’ is closed to new replies.