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