Title: Corner Case: Table plugin does not exist!
Last modified: August 21, 2016

---

# Corner Case: Table plugin does not exist!

 *  ResolvedPlugin Contributor [Greg Ross](https://wordpress.org/support/users/gregross/)
 * (@gregross)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/corner-case-table-plugin-does-not-exist/)
 * I installed the plugin and got the “Table plugin does not exist!” error on the
   stats page.
 * Disabling and enabling didn’t fix the problem.
 * Turns out it was a corner case in the logic. I installed it on a test site I 
   have on my local network and after I installed the plugin didn’t visit the site
   before going to the stats page.
 * The code that generates the error:
 *     ```
       $result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_useronline");
       		$result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_visit");
       		$result[] = $wpdb->query("SELECT * FROM {$table_prefix}statistics_visitor");
   
       		if( !$result[0] || !$result[1] || !$result[2] ) {
       			wp_die(__('Table plugin does not exist! Please disable and re-enable the plugin.', 'wp_statistics'));
       		}
       ```
   
 * Assumes that no results means the table doesn’t exist.
 * In my case the tables were there, just didn’t have any data. Simply visiting 
   the site added some data and cleared the error.
 * The best fix is probably to update the message to be a little more clear, something
   like:
 * “Plugin tables do not exist or are empty! Please disable and re-enable the plugin
   and or visit your site as a user.”
 * [http://wordpress.org/plugins/wp-statistics/](http://wordpress.org/plugins/wp-statistics/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/corner-case-table-plugin-does-not-exist/#post-4303474)
 * Was transferred to the email.

Viewing 1 replies (of 1 total)

The topic ‘Corner Case: Table plugin does not exist!’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/corner-case-table-plugin-does-not-exist/#post-4303474)
 * Status: resolved