SELECT T1.*, T2.Name, MIN(Preis/Personen) AS Preis, Rabatt, Max(Personen) AS MaxPersonen, Min(Personen) AS Personen, FROM_DAYS(TO_DAYS(T1.Ende) - T1.Mindauer) AS AnrEnde, T2.Bild1, T7.Name AS Typ, T10.Name AS Verpflegung FROM (angebote AS T1, hotel AS T2, preise AS T4, zimmer AS T3) LEFT JOIN verpflegung AS T10 ON T10.ID = T1.ID_Verpflegung LEFT JOIN typ AS T7 ON T7.ID =T3.ID_Typ WHERE T1.ID_Hotel = T2.ID AND ( TO_DAYS(T1.Ende) >= TO_DAYS(NOW()) ) AND T1.ID_Hotel=T4.ID_Hotel AND T1.ID = T4.ID_angebot AND T3.ID_Hotel=T4.ID_Hotel AND T3.ID=T4.ID_zimmer AND T1.ID_Hotel = and (Reisetyp !=0 or Reisetyp = 2) and (TO_DAYS(Ende)- T1.Mindauer) > TO_DAYS(NOW()) GROUP BY T1.ID ORDER BY T1.Start
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 (Reisetyp !=0 or Reisetyp = 2) and (TO_DAYS(Ende)- T1.Mindauer) > TO_DAYS(N' at line 15