Database Error; SQL: SELECT
DISTINCT
`t`.*
FROM `wp_posts` AS `t`
LEFT JOIN `wp_podsrel` AS `rel_select_album` ON
`rel_select_album`.`field_id` = 270
AND `rel_select_album`.`item_id` = `t`.`ID`
LEFT JOIN `wp_posts` AS `select_album` ON
`select_album`.`ID` = `rel_select_album`.`related_item_id`
WHERE ( ( `select_album`.`id` = ) AND ( `t`.`post_type` = 'gallery' ) 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` = 'gallery' ) AND ( `t`.`post_status` IN ( 'publish' ...' at line 14