Error when keyword is empty
-
Use Plugin Version Search Everything 8.1.9
If the query string is empty, the following error is returned
$searchQuery = $this->se_search_default();
se_search_default returns string ‘()’if ( $searchQuery != '' ) { // lets use _OUR_ query instead of WP's, as we have posts already included in our query as well(assuming it's not empty which we check for) $where = " AND ((" . $searchQuery . ")) "; }
This process is true
WordPress データベースエラー: [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 wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post’ at line 1]
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND ((())) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_author = 1 AND wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10
- The topic ‘Error when keyword is empty’ is closed to new replies.