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 'for-sale and session_id = "jkbqjke4hq361c1g4pcvh50066"' at line 1: SELECT * FROM reservas WHERE propiedad_fk = apartments-for-sale and session_id = "jkbqjke4hq361c1g4pcvh50066"