function update_batch($table = '', $set = NULL, $index = NULL)
{
// Combine any cached components with the current statements
$this->_merge_cache();
if (is_null($index)) {
if ($this->db_debug) {
return $this->display_error('db_myst_use_index');
}
return FALSE;
}
if (!is_null($set)) {
$this->set_update_batch($set, $index);
}
if (count($this->ar_set) == 0) {
if ($this->db_debug) {
return $this->display_error('db_must_use_set');
}
return FALSE;
}
if ($table == '') {
if (!isset($this->ar_from[0])) {
if ($this->db_debug) {
return $this->display_error('db_must_set_table');
}
return FALSE;
}
$table = $this->ar_from[0];
}
// Batch this baby
for ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100) {
$sql = $this->_update_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), array_slice($this->ar_set, $i, 100), $this->_protect_identifiers($index), $this->ar_where);
$this->query($sql);
}
$this->_reset_write();
}