Invalid query: No database selected Whole query: SELECT count(*) AS 'count' FROM `it_posts` WHERE `post_type` = 'dc_postdate';