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 v.deleted = 0 limit 1' at line 6
select * from tx_lumas_rahmen_varianten v where v.rahmenid = 2 and v.sys_language_uid = 0 and v.material = and v.deleted = 0 limit 1