Title: Not working, sql errors
Last modified: August 30, 2016

---

# Not working, sql errors

 *  Resolved [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/)
 * Hi,
 * I’ve just installed this and perhaps I’ve set it up wrong, but I’m not seeing
   any results after 24 hours.
 * With debug mode activated each of the sections is filled with
 * `SELECT author, COUNT(*) counthits FROM wp_ojup_slim_stats WHERE author IS NOT
   NULL AND dt BETWEEN 1441065600 AND 1442404422 GROUP BY author ORDER BY counthits
   DESC LIMIT 0, 100`
 * My MySQL error log is showing repeated entries of:
 * `SELECT author, COUNT(*) counthits FROM wp_ojup_slim_stats WHERE author IS NOT
   NULL AND dt BETWEEN 1441065600 AND 1442404422 GROUP BY author ORDER BY counthits
   DESC LIMIT 0, 100`
 * If I activate User Role Editor the entire site falls over
 * Thank you
 * John
 * [https://wordpress.org/plugins/wp-slimstat/](https://wordpress.org/plugins/wp-slimstat/)

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/not-working-sql-errors/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/not-working-sql-errors/page/2/?output_format=md)

 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550783)
 * Hi John,
 * I don’t see where the error is in that query. What happens if you try to run 
   it in phpmyadmin?
 * Camu
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550883)
 * Fixed. I reinstalled the plugin and it’s working.
 * Thank you
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550887)
 * Great. A review for Slimstat would be a nice way to say thank you 🙂
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550935)
 * We don’t cover technology in the publication unfortunately.
 * Can you tell me why the figures are so different:
 * Pageviews:
 * WP SiteStats – 219
    GA Dashboard – 210 Slimstats – 109
 * I know it had more than 109 views yesterday.
 * Thanks,
 * John
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550936)
 * Sorry, I meant a review here:
 * [https://wordpress.org/support/view/plugin-reviews/wp-slimstat#postform](https://wordpress.org/support/view/plugin-reviews/wp-slimstat#postform)
 * As for the discrepancy in numbers, there are many reasons why that might be happening.
   You may want to set Slimstat to work in Server Mode for starters, and see if 
   that helps.
 * Camu
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550937)
 * Ok, Thanks, WIll try that.
 * At the moment its showing no visits from anywhere in Asean and as we’re an Asean
   publication I find that a bit odd. LoL
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550966)
 * What is the URL? I’d like to run some tests…
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550968)
 * Hi Camu,
 * Thanks very much. It’s not showing any visits from Asia today either. A lot of
   people use VPNs down here because of the military snooping, but not everyone.
 * The url is [AEC News Today](http://aecnewstoday.com)
 * Thanks very much,
 * John
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6550976)
 * It looks like you have W3 Total Cache running on this website. Please completely
   clear its cache, so that Slimstat can append the tracking code to all the pages.
   I could not find it on the homepage, and that would explain why it’s not working
   as expected 🙂
 * Camu
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551031)
 * Hi Camu,
 * Afraid not. Have tried different tracking settings and flushed the WT3 caches
   twice each time between testing and WiTopia is showing figures such as 250 page
   views with 71 per cent from the US compared to GA showing 73 page views with 
   28 from Thailand, and others from other parts of Asia.
 * Thanks,
 * John
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551032)
 * Okay, now the tracking code is there, but the server is returning a 500 error
   message:
 * Request URL:[http://aecnewstoday.com/wp-admin/admin-ajax.php](http://aecnewstoday.com/wp-admin/admin-ajax.php)
   
   Request Method:POST Status Code:500 Internal Server Error
 * You may want to ask your provider to help you investigate this issue. Or see 
   if it is a conflict with another plugin.
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551033)
 * Hi Camu,
 * Slimstats is the last plugin installed. Before that there were no MySQL errors.
 * I just checked and this error is being returned.
 *     ```
       20150925T100520: aecnewstoday.com/wp-admin/admin.php
       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 '=> 1
          ORDER BY counthits DESC
          LIMIT 0, 100' at line 4 for query
          SELECT resource, COUNT(*) counthits
          FROM wp_ojup_slim_stats
          WHERE resource IS NOT NULL AND content_type <> "404" AND dt BETWEEN 1443139200 AND 1443215117
          GROUP BY resource HAVING COUNT(visit_id) => 1
          ORDER BY counthits DESC
          LIMIT 0, 100 made by do_action('
       ```
   
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551034)
 * This error should not be affecting the tracker, but the reports. We will look
   into it.
 *  Thread Starter [pattaya_web](https://wordpress.org/support/users/pattaya_web/)
 * (@pattaya_web)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551047)
 * Thanks,
 * But it’s simply not working. Slimstats doesn’t show a single visitor from Asia.
   And we’re an Asean publication with news of specific interest to an Asean readership
   so that’s impossible.
 * It’s also showing about 1/3 of the number of visitors that GA or JetPack are 
   showing.
 * Slimstats shows three content pages having received visits today, Jetpack shows
   11 and GA shows 13.
 * If we turn debug mode on every Slimstats window is full of MySQL error codes.
 *  Plugin Contributor [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * (@coolmann)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/#post-6551048)
 * Like I said, the tracker is triggering a 500 error code on your server, not sure
   why. That is EXACTLY the reason why the tracker is not working. You need to look
   at your web server error logs to see what that 500 error is about. I suspect 
   a botched installation, where the table structure is not up-to-date.
 * Cheers,
    Camu

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/not-working-sql-errors/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/not-working-sql-errors/page/2/?output_format=md)

The topic ‘Not working, sql errors’ is closed to new replies.

 * ![](https://ps.w.org/wp-slimstat/assets/icon.svg?rev=2832242)
 * [SlimStat Analytics](https://wordpress.org/plugins/wp-slimstat/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-slimstat/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-slimstat/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-slimstat/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-slimstat/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-slimstat/reviews/)

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 25 replies
 * 2 participants
 * Last reply from: [Jason Crouse](https://wordpress.org/support/users/coolmann/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/not-working-sql-errors/page/2/#post-6551067)
 * Status: resolved