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