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 'with-pool-for-12-people-3-km-from-the-beach and session_id = "nv3a3osug1cb34b...' at line 1: SELECT * FROM reservas WHERE propiedad_fk = luxurious-country-house-with-pool-for-12-people-3-km-from-the-beach and session_id = "nv3a3osug1cb34boebtu8v1dv7"