On Duplicate with two keys...

stone28

Registered User.
Local time
Today, 21:59
Joined
Aug 27, 2009
Messages
58
Hi All,

Is it possible?
Below I am using with with one key, but I would like to check two fields now before updating/adding new record.

What key it's looking for here? it has to be movie_id..

INSERT INTO tbl_movies_genre
(tbl_movies_genre.movie_id, tbl_movies_genre.movie_genre)
VALUES ('"& movieID &"', '"& movieGenre &"')
ON DUPLICATE KEY UPDATE tbl_movies_genre.movie_genre =movieGenre;

But I would like something like that:
INSERT INTO tbl_users_comments
(tbl_users_comments.movieID, tbl_users_comments.userID, tbl_users_comments.comment)
VALUES ('"& movieID &"', '"& userID &"', '"& movieComment &"')
ON DUPLICATE KEY UPDATE tbl_users_comments.comment =movieComment;

SO I would be checking if movieID and UserID exists already in a record.
 
But can I check with this two separate fields not two criteria for one field?
 

Users who are viewing this thread

Back
Top Bottom