SQL error - 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 bs.length_cm DESC' at line 17
SELECT b.*, bm.boat_make_name, bmo.boat_model_name, bml.boat_model_length_name, bs.length_cm, bb.listing_type, s.name as 'status_name', bs.*, ema.engine_make_name, emo.engine_model_name, hp.engine_hp_val, c.country_name, t.town_name, m.marina_name, bs.berths, bs.berths_crew, bs.display_engine_on_spec FROM boats b LEFT JOIN boat_brokerage bb ON b.id = bb.boat_id LEFT JOIN boat_specs bs ON b.id = bs.boat_id LEFT JOIN boat_make bm ON b.make = bm.id LEFT JOIN boat_model bmo ON b.model = bmo.id LEFT JOIN boat_model_length bml ON b.length = bml.id LEFT JOIN engine_make ema ON bs.engine_make = ema.engine_make_id LEFT JOIN engine_model emo ON bs.engine_model = emo.engine_model_id LEFT JOIN engine_hp hp ON bs.horse_power = hp.engine_hp_id LEFT JOIN db_country c ON b.country = c.id LEFT JOIN db_town t ON b.town = t.id LEFT JOIN db_marina m ON b.marina = m.id LEFT JOIN db_status s ON b.status = s.id WHERE b.`id` IN () ORDER BY bs.length_cm DESC