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 '}' at line 4
select a.*, b.peak_times, b.prepayment, b.annex_en, b.annex_it, b.annex_es, b.promotion_en as userpromo_en, b.promotion_it as userpromo_it, b.promotion_es as userpromo_es, b.markup FROM apartments as a, users as b WHERE a.userid=b.userid AND apartment_id={apartment_id}