誰かが私のsqlステートメントの間違いを見つけることができるかどうか疑問に思いました。新しいレコードがまだ存在しない場合は、テーブルに挿入したいと思います。存在する場合は、更新するだけです。日付フィールドの主キー。
これがphpに表示される私のステートメントと私が得ているエラーです:
INSERT INTO ExtraStats (date, supportStaff, startEmails, endEmails, emailsAnswered) VALUES ('$startDate', '$supportStaff', '$startEmail', '$endEmail', '$emailAnswered') ON DUPLICATE KEY UPDATE (supportStaff, startEmails, endEmails, emailsAnswered) VALUES ('$supportStaff', '$startEmail', '$endEmail', '$emailAnswered')
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 '(supportStaff, startEmails, endEmails, emailsAnswered) VALUES ('2', '3', '1', '3' at line 1