Title: Database error
Last modified: October 8, 2024

---

# Database error

 *  Resolved [koupmi](https://wordpress.org/support/users/koupmi/)
 * (@koupmi)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-error-412/)
 * When i turn debug log, i got this error:
 * [08-Oct-2024 08:37:08 UTC] [WP STATISTICS] [WARNING]: Unknown column ‘type’ in‘
   field list’
 * [08-Oct-2024 08:37:08 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT page_id FROM `wp433_statistics_pages` WHERE `type`
   = ‘page’ and `id` = 1985 ORDER BY date DESC made by require(‘wp-blog-header.php’),
   wp, WP->main, do_action_ref_array(‘wp’), WP_Hook->do_action, WP_Hook->apply_filters,
   WP_STATISTICS\Hits::trackServerSideCallback, WP_STATISTICS\Hits::record, WP_STATISTICS\
   Hits::recordOnline, WP_STATISTICS\UserOnline::record, WP_STATISTICS\UserOnline::
   update_user_online, WP_STATISTICS\Pages::getPageId
 * [08-Oct-2024 08:37:12 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT COUNT(*) FROM `wp433_statistics_pages` WHERE `
   type` = ” made by require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action,
   WP_Hook->apply_filters, WP_Statistics->plugin_setup, WP_Statistics->includes,
   require_once(‘/plugins/wp-statistics/includes/class-wp-statistics-install.php’),
   WP_STATISTICS\Install->__construct, WP_STATISTICS\Install::init_page_type_updater,
   WP_STATISTICS\Install::is_require_update_page, WP_STATISTICS\Install::get_require_number_update
 * [08-Oct-2024 08:37:13 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT page_id FROM `wp433_statistics_pages` WHERE `type`
   = ‘unknown’ and `id` = 0 ORDER BY date DESC made by require(‘wp-blog-header.php’),
   wp, WP->main, do_action_ref_array(‘wp’), WP_Hook->do_action, WP_Hook->apply_filters,
   WP_STATISTICS\Hits::trackServerSideCallback, WP_STATISTICS\Hits::record, WP_STATISTICS\
   Hits::recordOnline, WP_STATISTICS\UserOnline::record, WP_STATISTICS\UserOnline::
   update_user_online, WP_STATISTICS\Pages::getPageId
 * [08-Oct-2024 08:37:32 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT COUNT(*) FROM `wp433_statistics_pages` WHERE `
   type` = ” made by require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action,
   WP_Hook->apply_filters, WP_Statistics->plugin_setup, WP_Statistics->includes,
   require_once(‘/plugins/wp-statistics/includes/class-wp-statistics-install.php’),
   WP_STATISTICS\Install->__construct, WP_STATISTICS\Install::init_page_type_updater,
   WP_STATISTICS\Install::is_require_update_page, WP_STATISTICS\Install::get_require_number_update
 * [08-Oct-2024 08:37:44 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT COUNT(*) FROM `wp433_statistics_pages` WHERE `
   type` = ” made by require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action,
   WP_Hook->apply_filters, WP_Statistics->plugin_setup, WP_Statistics->includes,
   require_once(‘/plugins/wp-statistics/includes/class-wp-statistics-install.php’),
   WP_STATISTICS\Install->__construct, WP_STATISTICS\Install::init_page_type_updater,
   WP_STATISTICS\Install::is_require_update_page, WP_STATISTICS\Install::get_require_number_update
 * [08-Oct-2024 08:37:47 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT COUNT(*) FROM `wp433_statistics_pages` WHERE `
   type` = ” made by require_once(‘wp-load.php’), require_once(‘wp-config.php’),
   require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), WP_Hook->do_action,
   WP_Hook->apply_filters, WP_Statistics->plugin_setup, WP_Statistics->includes,
   require_once(‘/plugins/wp-statistics/includes/class-wp-statistics-install.php’),
   WP_STATISTICS\Install->__construct, WP_STATISTICS\Install::init_page_type_updater,
   WP_STATISTICS\Install::is_require_update_page, WP_STATISTICS\Install::get_require_number_update
 * [08-Oct-2024 08:37:50 UTC] WordPress database error Unknown column ‘type’ in ‘
   where clause’ for query SELECT COUNT(*) FROM `wp433_statistics_pages` WHERE `
   type` = ” made by require_once(‘wp-admin/admin.php’), require_once(‘wp-load.php’),
   require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘plugins_loaded’),
   WP_Hook->do_action, WP_Hook->apply_filters, WP_Statistics->plugin_setup, WP_Statistics-
   >includes, require_once(‘/plugins/wp-statistics/includes/class-wp-statistics-
   install.php’), WP_STATISTICS\Install->__construct, WP_STATISTICS\Install::init_page_type_updater,
   WP_STATISTICS\Install::is_require_update_page, WP_STATISTICS\Install::get_require_number_update

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

 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/database-error-412/#post-18060549)
 * Hello [@koupmi](https://wordpress.org/support/users/koupmi/),
 * Thank you for opening the thread!
 * Could you please provide more details about the issue you’re experiencing? On
   which specific page do you encounter the errors? Providing screenshots/screencasts
   can significantly help us investigate the issue and provide you with more accurate
   answers.
 * Additionally, could you share your site info with us? You can find it under **
   Tools > Site Health > Info** in your WordPress admin area.
 * Thank you for your cooperation!
 * Best regards
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/database-error-412/#post-18104829)
 * Hi [@koupmi](https://wordpress.org/support/users/koupmi/),
 * After reviewing the issue, it appears that the “type” column is missing from 
   the `statistics_pages` table, which is causing this issue.
 * To resolve it, please run the following SQL command in your database to add the
   column:
 * `ALTER TABLE wp433_statistics_pages ADD COLUMN type VARCHAR(180) AFTER id;`
 * This should fix the error, and data should be recorded without any issues moving
   forward.
 * We would appreciate it if you could let us know the results.
 * Regards
 *  [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * (@mhdizmni)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/database-error-412/#post-18163713)
 * Dear [@koupmi](https://wordpress.org/support/users/koupmi/),
 * We will mark this thread as “resolved” since we haven’t heard back from you in
   a while.
 * Please feel free to reopen it or create a new one if you still need help or have
   any further questions.
 * Thank you!
 * Regards,
   Matthew

Viewing 3 replies - 1 through 3 (of 3 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [Matthew](https://wordpress.org/support/users/mhdizmni/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/database-error-412/#post-18163713)
 * Status: resolved