You're mixing UPDATE and INSERT syntax:
UPDATE table set col='val',col2='val2' where id='3';
INSERT INTO table (col, col2) VALUES ('val', 'val2');
Insert statements do not take a "where" clause.
update: you can use "set" style inserts, but still you cannot use "where col=val" unless you're doing some INSERT ... SELECT
, but you can do "where 1" for some unknown reason.
INSERT INTO table set col='val',col2='val2';
manpreet
Best Answer
2 years ago
I realize that similar questions like this one have been asked before, some answered some not, but after trying each of the accepted answers I am no further ahead in 'seeing' my syntax error. I need a fresh set of eyes to look at this as I've been moving single and double quotes around for the last couple of hours to no avail. Here's my PHP/MYSQL string: