Database Error; SQL: SELECT DISTINCT d.id as post_id, `postTicket`.`post_name` as ticket_link, `pmp`.`meta_value` as price, `eventDateTime`.`meta_value` as event_date_time, `eventEndDateTime`.`meta_value` as event_end_date_time FROM `wp_posts` AS `t` LEFT JOIN `wp_pods_tc_events` AS `d` ON `d`.`id` = `t`.`ID` LEFT JOIN wp_postmeta pm ON pm.meta_value=d.id AND pm.meta_key="_event_name" LEFT JOIN wp_posts postTicket ON pm.post_id = postTicket.ID LEFT JOIN wp_postmeta pmp ON pmp.post_id=postTicket.id AND pmp.meta_key="_price" LEFT JOIN wp_postmeta eventDateTime ON eventDateTime.post_id=t.ID AND eventDateTime.meta_key="event_date_time" LEFT JOIN wp_postmeta eventEndDateTime ON eventEndDateTime.post_id=t.ID AND eventEndDateTime.meta_key="event_end_date_time" WHERE ( ( t.id IN () AND `eventDateTime`.`meta_value` >= curdate() AND `eventEndDateTime`.`meta_value` >= curdate() ) AND ( `t`.`post_type` = "tc_events" ) AND ( `t`.`post_status` IN ( "publish" ) ) ) ORDER BY `t`.`menu_order`, `t`.`post_title`, `t`.`post_date`; Response: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND `eventDateTime`.`meta_value` >= curdate() AND `eventEndDateTime`.`meta_val' at line 12