I’ve been seeing regular PHO errors being flagged but haven’t thought much of it as I am still just working through things. Might be prudent to see if there is something amiss though. Here’s the most recent log:
[BPS Pro htaccess Protected Secure PHP Error Log]
[05-Mar-2014 17:12:30 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘146’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[06-Mar-2014 06:52:41 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘337’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[06-Mar-2014 07:03:08 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘157’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[06-Mar-2014 17:03:31 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘608’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 08:42:31 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘5134’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 14:15:59 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘220’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 16:56:38 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘240’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 20:40:27 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘146’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 20:40:30 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘157’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[07-Mar-2014 20:40:32 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘337’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
From the error, it looks like the post_type field is missing from your wp_posts table. That’s really odd, because it should have been created by WordPress when it was installed. Have you done anything to modify the database schema? Can you log into phpMyAdmin?
Just read the error more carefully, and it looks like we might be hooking into the query when we are not supposed to. I know we addressed a similar problem recently in the 4.1.9 release. Have you tried updating to the 4.1.9.1.reg that is the most recent release?
It definitely is now as I’ve just done a complete uninstall, including dropping the SQL tables, and reinstalled 4.1.9.1.reg. I’ll leave it be for now as I don’t have time to do anything more for now. I’ll let you know if the error pops up again.
Thanks
[19-Mar-2014 16:46:32 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘213’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[19-Mar-2014 17:06:59 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘157’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[20-Mar-2014 01:55:30 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘227’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
The only thing I have done after reinstalling is make some changes to some elements of the General Settings.
I spent some time trying to duplicate this issue but I have not run into it. I’m running a vanilla install of WP along with EE 4.1.9.1 and I’ve adjusted various settings on the General Settings tab.
Do any of the plugins that you are using having an optimize feature for the database?
Also, could you share the name of the theme that you are using?
I don’t know if any of the plugins have an optimise feature for the the database. Looking at the database tables only BPS Pro, Contact Form and Event Espresso have added tables. Not sure of that is any help.
[27-Mar-2014 07:31:18 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘608’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[27-Mar-2014 21:08:44 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘157’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[28-Mar-2014 11:06:36 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘189’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
[28-Mar-2014 11:06:37 UTC] WordPress database error Unknown column ‘wp_posts.post_type’ in ‘where clause’ for query SELECT wp_comments.* FROM wp_comments WHERE comment_post_ID = ‘189’ AND comment_approved = ‘1’ AND wp_posts.post_type != ‘espresso_attendees’ ORDER BY comment_date_gmt DESC LIMIT 10 made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
The support post ‘PHP Error (2)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.