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 properties.is_for_sale = '1' ORDER BY properties.listed_date DESC, ...' at line 10