CodeIgniter Laravel PHP Example Javascript jQuery MORE Videos New
Need a Website Or Web Application Contact : +91 9437911966 (Whatsapp) Note: Paid Service

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');