select * from home_live where id={{items.id}} and active=1 and (enddate='0000-00-00' or enddate>'2020-11-27') and (startdate='0000-00-00' or startdate<='2020-11-27') 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>'2020-11-27') and ' at line 1