CodeIgniter: update_batch()

[php]
function db_save_settings()
{
$up_data = array();
foreach ($data as $id=>$value)
{
$up_data[] = array(
‘id’=>$id,
‘value’=>$value
);
}
if (count($up_data) == 0)
return FALSE;

$this->db->update_batch(‘settings’, $up_data, ‘id’);

if ($this->db->affected_rows() > 0)
{
return TRUE;
}
else
{
return FALSE;
}
}
[/php]