I'm attempting to query my database, but am getting the error:
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual th at corresponds to your MySQL server version for the right syntax to use near 'gr oup = 'new_fire', date = '2014-03-16', price = '', customer = '', seller = 'no' at line 1
But I can't seem to find the syntax error. I assume it has to do with the way that I'm putting the query together with the nodeMySQL module.
Here's my relevant node query snippet:
var salesData = [category, group, date, price, customer, name, commission];
...
connection.query(
'INSERT INTO `officeball`.`sales_entries` SET category = ?, group = ?, date = ?, price = ?, customer = ?, seller = ?, commission = ?',
salesData
)
And finally the query generated by phpmyadmin that I mean to execute:
INSERT INTO `officeball`.`sales_entries` (`sale_id`, `category`, `group`, `date`, `price`, `customer`, `seller`, `accepted`, `commission`, `commission_status`) VALUES ('', 'fire', 'new_fire', '2014-03-16', '123', 'joey bob', 'node user', '', '34', '')
I left the accepted and commission_status out in the node query, they can remain blank.
Is my error in this query?