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 '/36/st-lucia' 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 30 , 30/36/st-lucia