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 '/32/orlando' at line 1 SELECT * FROM HOTEL_CONTENT LEFT JOIN HOTELS ON HOTEL_CONTENT.HID = HOTELS.HID where thumb_url is not NULL AND thumb_url <> '' limit 0 , 30/32/orlando