Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

[3.1.2] update_batch not work

$
0
0
Code:
$dataTotal = array(
  array(
      'id' => 1,
      'name' => 'house',
      'description' => 'this house'
  ),
  array(
      'id' => 2,
      'name' => 'car',
      'description' => 'black car'
  )
);

$this->function_model->updateData($dataTotal);

public function updateData($data=NULL){
   $this->db->update_batch('mytable',$data,'id');
}

// Produces:
// UPDATE `mytable` SET `name` = CASE
// WHEN `id` = THEN 'house'
// WHEN `id` = THEN 'car'
// ELSE `name` END,
// `description` = CASE
// WHEN `id` = THEN 'this house'
// WHEN `id` = THEN 'black car'
// ELSE `description` END
// WHERE `id` IN (1,2)

With the new update the system does not capture the value of index.

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>