your id_msg
cant be duplicated because its primary key
. you maybe interested to just update numbers_msg
.
like that:
UPDATE table_messages SET numbers_msg = 50 WHERE id_msg = 4 ;
Or :
delete old id_msg = 4 and then use your query.
INSERT INTO table_messages (number_msg, id_msg) VALUES (50, 4);