CodeIgniter Laravel PHP Example Javascript jQuery MORE Videos New

How to update multiple row in codeigniter

There is indeed an update_batch() method available in CodeIgniter already.

You can use it your example like so:


$data = array(
    array(
        'ID' => 1,
        'Settings Name' => 'Hello',
        'Settings Value' => 'True'
    ),
    array(
        'ID' => 2,
        'Settings Name' => 'World',
        'Settings Value' => 'Good'
    )
);
$this->db->update_batch('tableName', $data, 'id');