with insert on duplicate key update - updating multiple rows at once

by almost okey   Last Updated September 16, 2018 13:10 PM - source

With latest joomla version I try to achieve one query to the database and updating multiple rows at once.

I want to make a query like this:

INSERT INTO `tablename`
(`id`,`date`) VALUES 
(`date` = '2018-12-01'),(`date` = '2018-10-01'),(`date` = '2018-06-01'),(`date` = '2019-01-01')

If I setup this and debug:


this only produces the first 3 row of my wanted query. How can I extend to add the text "ON DUPLICATE KEY UPDATE" and another array values to the end? Or there is another way of doing this? Its possible to add multiple query to setQuery, or concatenate queries?

Related Questions

Joomla query for monthly result in a graph

Updated February 27, 2017 14:10 PM

Method for creating a subquery using JDatabase

Updated February 03, 2019 17:10 PM