here is the error
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 ‘order ASC LIMIT 100’ at line 1.
here is the query passed to PDO for a prepared execute
SELECT * FROM web_menu_items WHERE menuId = ? ORDER BY order ASC LIMIT 100
here are the variables passed to the prepared execute
array(0 => "1")
here is the table structure
CREATE TABLE IF NOT EXISTS `web_menu_items` (
`id` int(11) NOT NULL auto_increment,
`menuId` int(11) NOT NULL,
`order` int(11) NOT NULL,
`requiredAccess` int(11) NOT NULL,
`hideIfNotAccess` int(11) NOT NULL,
`label` varchar(128) NOT NULL,
`link` varchar(128) NOT NULL,
`tagId` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
KEY `menuId` (`menuId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
what am I not seeing here? why is this a syntax error?
orderis a reserved word in mySQL.Put backticks around it:
or consider renaming the field.