Database Error; SQL: SELECT DISTINCT `t`.*, `d`.* FROM `wp_ychtposts` AS `t` LEFT JOIN `wp_ychtpodsrel` AS `rel_yacht_ship_owner` ON `rel_yacht_ship_owner`.`field_id` = 1434 AND `rel_yacht_ship_owner`.`item_id` = `t`.`ID` LEFT JOIN `wp_ychtposts` AS `yacht_ship_owner` ON `yacht_ship_owner`.`ID` = `rel_yacht_ship_owner`.`related_item_id` LEFT JOIN `wp_ychtpods_yacht` AS `d` ON `d`.`id` = `t`.`ID` WHERE ( ( `yacht_ship_owner`.`ID` = ) AND ( `t`.`post_type` = "yacht" ) 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 MariaDB server version for the right syntax to use near ') AND ( `t`.`post_type` = "yacht" ) AND ( `t`.`post_status` IN ( "publish" ) ) )' at line 15