select * from home_live where id={{items.id}} and active=1 and (enddate='0000-00-00' or enddate>'2021-09-17') and (startdate='0000-00-00' or startdate<='2021-09-17') order by startdate desc limit 1
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 '{items.id}} and active=1 and (enddate='0000-00-00' or enddate>'2021-09-17') and ' at line 1