Title: Database Error
Last modified: February 6, 2025

---

# Database Error

 *  Resolved [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/)
 * Hi there,
 * after installing WP-Statistics 14.12.2 into a WordPress 7.1.12 we get these Errors
   in the eMail Report:
 * **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 ‘%i DESC’ at line 1]
   `SELECT COUNT(DISTINCT visitor.ID) AS visitors,
   visitor.referred, visitor.source_channel, visitor.source_name, visitor.last_counter
   FROM wp_statistics_visitor AS visitor WHERE visitor.referred IS NOT NULL AND 
   visitor.referred != '' AND DATE(visitor.last_counter) BETWEEN '2025-01-31' AND'
   2025-01-31' GROUP BY visitor.referred ORDER BY %i DESC`
 * Maybe %i is the Problem here?

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

 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18288418)
 * Hi [@gerdski](https://wordpress.org/support/users/gerdski/),
 * I’ve escalated this matter to our team for further review and investigation.
 * We will get back to you once we have an update.
 * Thank you for your patience and understanding!
 * Regards,
   Matthew
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18288444)
 * Dear [@gerdski](https://wordpress.org/support/users/gerdski/),
 * You mentioned using “WordPress 7.1.12”, but it doesn’t appear to be a valid version
   of WordPress.
 * Could you kindly share the exact **PHP version**, **Database Extension and version**,
   as well as your **WordPress version**?
 * You can find this information by navigating to **Tools > Site Health > Info**.
   Here’s an image for your reference: [https://i.vgy.me/AHg1r5.png](https://i.vgy.me/AHg1r5.png).
 * Thank you!
 *  Thread Starter [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18288450)
 * Oh dear, sorry, I was wrong. It is 5.7.12
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18289290)
 * Dear [@gerdski](https://wordpress.org/support/users/gerdski/),
 * Would it be possible for you to update WordPress to the latest version?
 * This issue appears to occur in WordPress versions prior to 6.2.
 * We highly recommend keeping WordPress and all plugins up to date for optimal 
   performance and security.
 * Looking forward to your response.
 * Regards,
   Matthew
 *  Thread Starter [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18289736)
 * Thanks. Sorry, but it cannot be done at the moment.
 * Maybe there’s a WP-Statistics Version prior to 14.12.2 that would work?
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18294560)
 * Dear [@gerdski](https://wordpress.org/support/users/gerdski/),
 * Please note that **WordPress 6.2 or newer** is required to avoid this error.
 * We highly recommend keeping WordPress and all plugins up to date to ensure optimal
   performance and security.
 * Regards,
   Matthew
 *  Thread Starter [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/database-error-417/#post-18295764)
 * Yes, I’ve seen that. Sorry but we cannot update WordPress at the moment.
 * What Version of WP Statistics would be suitable for WP 5.7.12?
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/database-error-417/#post-18298111)
 * Dear [@gerdski](https://wordpress.org/support/users/gerdski/),
 * Kindly note that you can use an older version of WP Statistics, such as v14.10
   or earlier, for WordPress 5.7.12.
 * However, please be aware that we’ve had two major releases since then, introducing
   new features and improvements. By downgrading to an older version, you won’t 
   be able to access these features.
 * We highly recommend keeping WordPress and all plugins up to date to ensure you
   benefit from the latest features and security updates. That said, if you prefer
   to download an older version, you can do so using the link below:
 * [https://wordpress.org/plugins/wp-statistics/advanced/](https://wordpress.org/plugins/wp-statistics/advanced/)
 * Regards,
   Matthew
 *  Thread Starter [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/database-error-417/#post-18307642)
 * Everybody always recommends to update everything, but in our case this would 
   result in either a Whitescreen of Death or a lot of work to avoid that, and we
   don’t have the time to do this right now. Sorry.
 * We’ll go for 14.10 or earlier.
 * Thanks 🙂
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/database-error-417/#post-18323285)
 * Dear [@gerdski](https://wordpress.org/support/users/gerdski/),
 * I’m pleased to inform you that we have resolved the database error in **version
   14.12.5**, ensuring compatibility with WordPress versions earlier than 6.2.
 * Could you please update the plugin to the latest version and verify if everything
   is working as expected?
 * Thank you for your continued support!
 * Regards,
   Matthew
 *  Thread Starter [Gerdski](https://wordpress.org/support/users/gerdski/)
 * (@gerdski)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/database-error-417/#post-18324363)
 * Hello,
 * and thanks a lot. We have deactivated WPS for the moment, but I’ll ask the Customer
   if we can reactivate it.
 * Thanks!

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

The topic ‘Database Error’ is closed to new replies.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Gerdski](https://wordpress.org/support/users/gerdski/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/database-error-417/#post-18324363)
 * Status: resolved