This can be accomplished by using ->insert()
and ->values()
, with the $values
being an array of the strings with the columns to insert.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$columns = array('col_one','col_two');
$values = array();
// Proper escaping/quotes should be done here, and probably in a loop, but cluttered the answer, so omitted it
$values[] = '1, "one"';
$values[] = '2, "two"';
$values[] = '3, "three"';
$values[] = '999, "nineninetynine"';
$query->insert($db->quoteName('#__tablename'));
$query->columns($columns);
$query->values($values);
$db->setQuery($query);
$db->query();
SQL that is produced using echo $query->dump()
INSERT INTO `xyz_tablename`
(col_one,col_two) VALUES
(1, "one"),(2, "two"),(3, "three),(999, "nineninetynine")