Title: Error in plugin
Last modified: October 18, 2017

---

# Error in plugin

 *  Resolved [sokolovichi](https://wordpress.org/support/users/sokolovichi/)
 * (@sokolovichi)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-in-plugin-14/)
 * Our plugin is configured to display popular posts visited within last 7 days.
   It worked fine up until recently. It looks like the database column name has 
   changed and the query can’t access the right column anymore.
    Here’s the error
   produced on the website:
 * WordPress database error: [Unknown column ‘v.view_datetime’ in ‘where clause’]
   
   SELECT p.ID AS id, p.post_title AS title, p.post_author AS uid FROM `wlg_popularpostssummary`
   v LEFT JOIN `wlg_posts` p ON v.postid = p.ID WHERE 1 = 1 AND p.post_type IN(‘
   post’) AND v.view_datetime > DATE_SUB(‘2017-10-18 11:10:08’, INTERVAL 6 DAY) 
   AND p.post_password = ” AND p.post_status = ‘publish’ GROUP BY v.postid ORDER
   BY SUM(v.pageviews) DESC LIMIT 10;
 * Sorry. No data so far.
 * When I inspect popularpostssummary DB table, there is no view_datetime column,
   but there is a last_viewed column now.
 * Could you please fix?
 * Thanks!
 * – Ivan

Viewing 1 replies (of 1 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-in-plugin-14/#post-9598670)
 * Hey Ivan!
 * Please [check here](https://wordpress.org/support/topic/most-viewed-is-0/#post-9588028).

Viewing 1 replies (of 1 total)

The topic ‘Error in plugin’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/error-in-plugin-14/#post-9598670)
 * Status: resolved