Title: WordPress database error
Last modified: October 29, 2021

---

# WordPress database error

 *  Resolved [hassimkhan](https://wordpress.org/support/users/hassimkhan/)
 * (@hassimkhan)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-171/)
 * Hello,
 * The plugin is giving a database error, please fix as soon as possible:
 * SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17
 * The 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 '-1' at line 11 for query SELECT SQL_CALC_FOUND_ROWS  posts.ID FROM posts  LEFT JOIN term_relationships ON (posts.ID = term_relationships.object_id)  LEFT JOIN term_relationships AS tt1 ON (posts.ID = tt1.object_id) WHERE 1=1  AND ( 
         posts.ID NOT IN (
       				SELECT object_id
       				FROM term_relationships
       				WHERE term_taxonomy_id IN (XXX)
       			) 
         AND 
         term_relationships.term_taxonomy_id IN (XXX) 
         AND 
         tt1.term_taxonomy_id IN (XXX)
       ) AND posts.post_type = 'product' AND (posts.post_status = 'publish' OR posts.post_status = 'private') GROUP BY posts.ID ORDER BY posts.ID ASC LIMIT 0
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [Zorem](https://wordpress.org/support/users/zorem/)
 * (@zorem)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-171/#post-15024439)
 * Hi [@hassimkhan](https://wordpress.org/support/users/hassimkhan/),
 * It’s not relevant to our plugin. maybe it’s coming from another plugin.
 * Thanks 🙂

Viewing 1 replies (of 1 total)

The topic ‘WordPress database error’ is closed to new replies.

 * ![](https://ps.w.org/woo-product-country-base-restrictions/assets/icon-256x256.
   png?rev=2808588)
 * [Country Based Restrictions for WooCommerce](https://wordpress.org/plugins/woo-product-country-base-restrictions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-product-country-base-restrictions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-product-country-base-restrictions/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-product-country-base-restrictions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-product-country-base-restrictions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-product-country-base-restrictions/reviews/)

## Tags

 * [plugin error](https://wordpress.org/support/topic-tag/plugin-error/)

 * 1 reply
 * 2 participants
 * Last reply from: [Zorem](https://wordpress.org/support/users/zorem/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/wordpress-database-error-171/#post-15024439)
 * Status: resolved