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-18-people-with-air-conditioning-and-pool and session_id = "nv3a3osug1cb34...' at line 1: SELECT * FROM reservas WHERE propiedad_fk = large-country-house-for-18-people-with-air-conditioning-and-pool and session_id = "nv3a3osug1cb34boebtu8v1dv7"