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 'in-the-center and session_id = "0so53bj8p3ks1udd7tkhb1hdh2"' at line 1: SELECT * FROM reservas WHERE propiedad_fk = apartment-in-the-center and session_id = "0so53bj8p3ks1udd7tkhb1hdh2"