You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',sort ASC LIMIT 1' at line 1 in this syntax SELECT `node`.`node`, `node`.`application`, `node`.`area`, `node`.`name`, `node`.`path`, `node`.`parent`, `node`.`rank`, `node`.`sort`, `node`.`status`, `node`.`created`, `node_page`.`node_id`, `node_page`.`languages`, `node_page`.`images`, `node_page`.`title`, `node_page`.`notes`, `node_page`.`banner_effect`, `node_page`.`banner_option`, `node_page`.`banner_pagination`, `node_page`.`banner_content`, `node_page`.`keyword`, `node_page`.`description`, `node_page`.`head`, `node_page`.`content` FROM `node` LEFT JOIN `node_page` ON `node`.`node_id` = `node_page`.`node_id` WHERE (role = 0 OR role = '3' OR role LIKE '3,%' OR role LIKE '%,3,%' OR role LIKE '%,3') AND node.node = 'city-download' AND node_page.languages = 'default' ORDER BY rank,sort ASC LIMIT 1