Database Error; SQL: SELECT
DISTINCT
d.*, count(`people`.`people_name`) as total
FROM `wp_posts` AS `t`
LEFT JOIN `wp_podsrel` AS `rel_related_board` ON
`rel_related_board`.`field_id` = 21
AND `rel_related_board`.`item_id` = `t`.`ID`
LEFT JOIN `wp_posts` AS `related_board` ON
`related_board`.`ID` = `rel_related_board`.`related_item_id`
LEFT JOIN `wp_podsrel` AS `rel_related_people` ON
`rel_related_people`.`field_id` = 20
AND `rel_related_people`.`item_id` = `t`.`ID`
LEFT JOIN `wp_posts` AS `related_people` ON
`related_people`.`ID` = `rel_related_people`.`related_item_id`
LEFT JOIN `wp_pods_people_board` AS `d` ON `d`.`id` = `t`.`ID`
LEFT JOIN `wp_pods_people` AS `people` ON `people`.`ID` = `rel_related_people`.`related_item_id`
WHERE ( ( `related_board`.`id` = AND `related_people`.`id` IS NOT NULL AND ((start_date = '2024-11-03' OR end_date = '0000-00-00')) ) AND ( `t`.`post_type` = 'people_board' ) AND ( `t`.`post_status` IN ( 'publish' ) ) )
GROUP BY d.role, d.role_description
ORDER BY sort_order asc, `people`.`people_name` asc, `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 `related_people`.`id` IS NOT NULL AND ((start_date <= '2024-11-03' OR start_' at line 24