1

i want to append new values to the existing event id and value. so i used ON DUPLICATE KEY. but why is sql writing new row eventhough the row has existed? am i doing anything wrong? :'(

i'm using MySQL in phpmyadmin

my unique key: event_id

my database

INSERT INTO et_seats(event_id, reserved) VALUES ('$theatre->id', '$payment->seatnumber')
ON DUPLICATE KEY UPDATE 
            reserved = reserved + '$comma' + '$payment->seatnumber'
the.mungk
  • 21
  • 5

0 Answers0