CodeIgniter Forums
[Solved]Update_batch without escape? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: [Solved]Update_batch without escape? (/showthread.php?tid=66415)



[Solved]Update_batch without escape? - Maeggi07 - 10-20-2016

Hello @ll,
have any Idea for escape false in update_batch?

//Für Single
PHP Code:
$this->db->set('field''field+1'FALSE);
$this->db->where('id'2);
$this->db->update('mytable'); 

//Multiple ???
PHP Code:
$data = array(
 
  array(
 
     'id' => 'ID' ,
 
     'field' => 'field+1'          //False?
 
     'points' => 'points+1'       //False?
 
  ),
 
  array(
 
     'id' => 'ID' ,
 
     'field' => 'field+1'          //False?
 
     'points' => 'points+1'       //False?
 
  ),
);

$this->db->update_batch('mytable'$data'id'); 



RE: Update_batch without escape? - Narf - 10-20-2016

Can't happen.

Make 2+ separate updates and if you're concerned about performance, do them inside a transaction.


RE: Update_batch without escape? - Maeggi07 - 10-20-2016

I thought to myself Smile

Thanks