Welcome Guest, Not a member yet? Register   Sign In
[3.1.2] update_batch not work
#3

(10-31-2016, 08:51 AM)rodrigoprazim Wrote:
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.
Reply


Messages In This Thread
[3.1.2] update_batch not work - by rodrigoprazim - 10-31-2016, 08:51 AM
RE: [3.1.2] update_batch not work - by JarredB - 10-31-2016, 06:04 PM
RE: [3.1.2] update_batch not work - by pgee - 11-02-2016, 04:21 AM
RE: [3.1.2] update_batch not work - by pgee - 11-02-2016, 04:23 AM
RE: [3.1.2] update_batch not work - by marcan - 01-07-2017, 09:37 AM
RE: [3.1.2] update_batch not work - by Narf - 12-12-2016, 05:21 AM
RE: [3.1.2] update_batch not work - by Narf - 12-12-2016, 09:57 AM
RE: [3.1.2] update_batch not work - by PaulD - 12-29-2016, 07:05 PM
RE: [3.1.2] update_batch not work - by enlivenapp - 01-02-2017, 09:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB