no dups

Codes here !

Moderators: macek, egami, gesf

Post Reply
NigelRen
php-forum Fan User
php-forum Fan User
Posts: 610
Joined: Fri Aug 05, 2011 9:53 am

Re: no dups

Post by NigelRen » Fri Aug 17, 2012 12:32 am

I've seen things like

Code: Select all

INSERT INTO moviedb.genre (GenreID,GenreName)
VALUES ('18', 'Drama'),
    ('16', 'Animation')
ON DUPLICATE KEY UPDATE
  GenreName = VALUES(GenreName);
Try using the values() part where you want to set the value of the updated field.
Also as sim_name is probably your primary key - you don't need that in your update part.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest