I have read the documentation and cant see what is wrong with my Statement
Errors are hitting at the 'KEY'
INSERT INTO employeedetails (userid,ref,name,department,commenced) VALUES
('$userid','$ref','$name','$department','$commenced')
ON DUPLICATE KEY UPDATE
ref='" . $ref . "',
name = '" . $name . "',
department = '" . $department . "',
commenced = '" . $commenced . "'
WHERE userid=" . $userid;
Thank you very much!
EDIT:
The Primary KEY is 'userid'
INSERT INTO employeedetails (userid,ref,name,department,commenced)
VALUES ('1','11','','','2017-03-08 00:00:00') ON DUPLICATE KEY UPDATE ref='11',
name = '', department = '', commenced = '2017-03-08 00:00:00' WHERE userid=1
The Error is: Unrecognized keyword. (near "KEY" at position 529)