I have the latest version of wp-rentals, db etc. installed and have started to receive the following db 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 www_posts.post_type = ‘wpestate_message’ AND (www_posts.post_status = ‘’ at line 1]
SELECT SQL_CALC_FOUND_ROWS www_posts.ID FROM www_posts WHERE 1=1 AND ((())) AND www_posts.post_type = 'wpestate_message' AND (www_posts.post_status = 'publish' OR www_posts.post_status = 'expired' OR www_posts.post_status = 'future' OR www_posts.post_status = 'draft' OR www_posts.post_status = 'pending' OR www_posts.post_status = 'private') ORDER BY www_posts.post_date DESC LIMIT 0, 20
The error is in the www_posts but have no idea how to fix this.
To invoke the error you only need go to any of the sections, Properties, Booking, etc and search with an empty field.
wp rentals have not seen this before only asking to re-install wp.
If anyone can offer any help or advice, its much appreciated.
The error in that SQL query is this part (if you remove this part, the query runs without errors):
AND ((()))
This SQL query you posted is the result of a PHP code (inside theme’s functions files), code that uses WP_Query with incorrect arguments (most probably empty arguments - resulted from exactly what you’ve said, searching with an empty field).
So, in my opinion, reinstalling WordPress won’t help!
What will help is to contact again the author and tell him exactly what/how you search, so that he can have a look at how the WP_Query is written for that search.
From my experience with this type of error, you just found found a particular situation which isn’t covered by the code. Just contact the author again, explaining step-by-step the reproduction steps and he will know how to help.
Hi, just an update.
Im told that the problem is with wp itself as changing the theme still doesn’t help either.
EG. going to tools, export personal data give this error.
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 www_posts.post_type = ‘user_request’ AND ((www_posts.post_status <> ‘tr’ at line 1]
SELECT SQL_CALC_FOUND_ROWS www_posts.ID FROM www_posts WHERE 1=1 AND www_posts.post_name IN ('export_personal_data') AND ((())) AND www_posts.post_type = 'user_request' AND ((www_posts.post_status <> 'trash' AND www_posts.post_status <> 'auto-draft')) ORDER BY www_posts.post_date DESC LIMIT 0, 21
ActivateDelete Adds search functionality without modifying any template pages: Activate, Configure and Search. Options Include: search highlight, search pages, excerpts, attachments, drafts, comments, tags and custom fields (metadata). Also offers the ability to exclude specific pages and posts. Does not search password-protected content.