Title: Database errors on multisite
Last modified: August 21, 2016

---

# Database errors on multisite

 *  Resolved [J.D. Grimes](https://wordpress.org/support/users/jdgrimes/)
 * (@jdgrimes)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/)
 * I have a client running this plugin on a multisite install. It is version 3.7.1,
   and running version 1.0.2 of your plugin. (I know that neither of those are the
   latest version, but I’ve looked at the code and I think the issues reported below
   are still relevant for the latest versions.) We are having errors like this in
   the error log:
 *     ```
       [31-Dec-2013 20:41:32 UTC] WordPress database error Table 'db.prefix_power_stats_pageviews' doesn't exist for query UPDATE prefix_power_stats_pageviews SET <code>hits</code> = <code>hits</code> + 1 WHERE <code>date</code> = '2013-12-31' made by shutdown_action_hook, do_action('shutdown'), call_user_func_array, power_stats_init, PowerStats->__construct, PowerStats->log_pageviews
       ```
   
 * In short, the database table it is trying to write to does not exist. I think
   that possibly this is due to a problem in the installation code. There is this
   line in `wp_power_stats_activate()`:
 *     ```
       if ($networkwide) {
       ```
   
 * However, `$networkwide` is not defined anywhere, so this will always be false.
 * In essence, the installation is not being performed correctly on multisite.
 * [http://wordpress.org/plugins/wp-power-stats/](http://wordpress.org/plugins/wp-power-stats/)

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

 *  Plugin Author [artifex404](https://wordpress.org/support/users/artifex404/)
 * (@artifex404)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/#post-4459618)
 * Thank you so much for your report! Yes, the issue is still relevant. The bug 
   will be fixed in the next version of the plugin.
 *  Thread Starter [J.D. Grimes](https://wordpress.org/support/users/jdgrimes/)
 * (@jdgrimes)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/#post-4459619)
 * You are welcome. Thank you for the quick response.
 *  Plugin Author [artifex404](https://wordpress.org/support/users/artifex404/)
 * (@artifex404)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/#post-4459767)
 * This issue has been fixed (as of version 1.1).
 *  [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 9 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/#post-4459835)
 * It seems that you have it fixed for multisite, but only when network activated.
   When in a multisite and activating for a specific sub site, the tables aren’t
   getting created. Worth checking on.

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

The topic ‘Database errors on multisite’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-power-stats_f8f8f8.svg)
 * [WP Power Stats](https://wordpress.org/plugins/wp-power-stats/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-power-stats/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-power-stats/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-power-stats/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-power-stats/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-power-stats/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)

 * 4 replies
 * 3 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/database-errors-on-multisite/#post-4459835)
 * Status: resolved