I'm getting this error when I create a new category through the admin.
Any ideas as to what I could be doing wrong?
A bug, perhaps?
A Database Error Occurred
Error Number: 1064
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, section, link) VALUES ('', 'Test', '', 'yes', '', 'News', '') ON DUPLICAT' at line 1
INSERT IGNORE INTO categories (id, name, description, published, order, section, link) VALUES ('', 'Test', '', 'yes', '', 'News', '') ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), name = VALUES(name), description = VALUES(description), published = VALUES(published), order = VALUES(order), section = VALUES(section), link = VALUES(link)
Filename: core/MY_DB_mysql_driver.php
Line Number: 265
Comments
INSERT IGNORE INTO categories (id, name, description, published, order, section, link) VALUES ('', 'Test', '', 'yes', '', 'News', '') ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id), name = VALUES(name), description = VALUES(description), published = VALUES(published), order = VALUES(order), section = VALUES(section), link = VALUES(link)
I threw that query into SQLpro and got the same error.
I had someone else come by and put another set of eyes on it, and it was the use of the word 'order', which is a reserved word in SQL, that was causing the problem.
I changed the name of the column and the query ran fine.
So, problem solved!