Answer the question
In order to leave comments, you need to log in
How to return id when updating ON DUPLICATE KEY UPDATE?
Good evening!
There is the following request:
INSERT INTO `group_attributes`
VALUES (NULL, :title)
ON DUPLICATE KEY UPDATE title = :title
Answer the question
In order to leave comments, you need to log in
ON DUPLICATE KEY UPDATE id=LAST_INSERT_ID(id)
Documentation - dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question