SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id WHERE wp_postmeta.meta_key = 'cp_sys_expire_date' AND timediff(STR_TO_DATE(wp_postmeta.meta_value, '%m/%d/%Y %H:%i:%s'), now()) <= 0 AND wp_posts.post_status = 'publish' AND wp_posts.post_type = 'ad_listing';
$qryToString = "SELECT $wpdb->posts.ID FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id WHERE $wpdb->postmeta.meta_key = 'cp_sys_expire_date' AND STR_TO_DATE($wpdb->postmeta.meta_value, '%m/%d/%Y %H:%i:%s') <= now() AND $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = '".APP_POST_TYPE."'";
There are currently 1 users browsing this thread. (0 members and 1 guests)