DROP TABLE IF EXISTS `tm_user_wished`; CREATE TABLE `tm_user_wished` ( `id_user` int(10) NOT NULL default '0', `id_tm` int(6) NOT NULL default '0', `i_date` int(10) NOT NULL default '0', UNIQUE KEY `users_wished_tms` USING BTREE (`id_user`,`id_tm`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- Table created INSERT INTO tm_user_wished SET id_user=1,id_tm=11 ON DUPLICATE KEY UPDATE i_date=1; INSERT INTO tm_user_wished SET id_user=1,id_tm=11 ON DUPLICATE KEY UPDATE i_date=2; SELECT * FROM tm_user_wished; -- You can see that i_date is update as expected -- However, following inserts aren't duplicates of unique id_user/id_tm index, -- but it updating the previous record instead of adding new ones as expeted INSERT INTO tm_user_wished SET id_user=1,id_tm=22 ON DUPLICATE KEY UPDATE i_date=1; INSERT INTO tm_user_wished SET id_user=2,id_tm=11 ON DUPLICATE KEY UPDATE i_date=2; SELECT * FROM tm_user_wished;