I have a insert on duplicate key update query I want to run to check if there is a record in the sitemap, update it if it exists or insert a new record if it doesn't exist.
In my case the potential duplicate key is a unique text field (url_sef), my query inserts a new record perfectly but does not update an existing one. Can anyone suggest any changes I could make to get this to work or perhaps using a different method all together?
INSERT INTO health3_acesef_sitemap
(url_sef, published, sdate, frequency, priority, sparent, sorder)
VALUES ('community-support-services/budgeting-a-financial-services/golden-bay-budget-service', 1, NOW(), 'weekly', '0.5', 0, 1000) ON DUPLICATE KEY UPDATE published=IF(url_sef='community-support-services/budgeting-a-financial-services/golden-bay-budget-service', published=1, published);