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-of-puerto-pollensa and session_id = "cckcfhiok83s75560o2b07v3v0"' at line 1: SELECT * FROM reservas WHERE propiedad_fk = 3-bedroom-apartment-in-the-center-of-puerto-pollensa and session_id = "cckcfhiok83s75560o2b07v3v0"