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 '} AND del = 0' at line 161064 SELECT i.*, t.options as opts, as category_name, as store_category_name, as os_name FROM `CA_inventory` i LEFT JOIN `CA_inventory_types` t ON i.type_id = LEFT JOIN `CA_inventory_categories` c ON = i.category_id LEFT JOIN `CA_inventory_os` o ON = i.os_id LEFT JOIN `CA_store_categories` sc ON = i.store_category_id WHERE = {uri} AND del = 0