GreŇ°ka: 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 'order by type asc limit 1' at line 1Select as brodident, yachts.deposit, yachts.charter,, yachts.companyid, yachts.locationid, yachts.yachtcategoryid, yachts.yachtmodelname, yachts.yachtbuilderid, yachts.loa, yachts.beam, yachts.cabins, yachts.cabinscrew, yachts.berthscabin, yachts.berthssalon, yachts.berthscrew, yachts.wc, yachts.wccrew, yachts.buildyear, yachts.aktivan, yachts.wifi, yachts.cijenamin,, yachts.motor, yachts.popust, yachts.engines, yachts.enginepower, slike.local, slike.url, slike.type, as charterid,, charteri.dohvati, as locationid, locations.regionid, locations.nameen as lokacija, as regijaid, regije.countryid, regije.namede as regijanaziv, as buildernaziv from danielis_baza3rdn.brodovi yachts inner join danielis_baza3rdn.charteri charteri on inner join danielis_baza3rdn.lokacije locations on inner join danielis_baza3rdn.brod_buileri builderi on left join danielis_baza3rdn.regije regije on left join danielis_baza3rdn.slike slike on where 1 and yachts.aktivan=1 and (charteri.dohvati=1 or and yachts.cijenamin>0 and regije.countryid = 1 and slike.type=1 group by order by yachts.cijenamin asc, asc limit 50