Welcome Guest, Not a member yet? Register   Sign In
Update Batch
#2

The general usage of update_batch is like this:
PHP Code:
$data = array(
   array(
      
'title' => 'My title' ,
      
'name' => 'My Name 2' ,
      
'date' => 'My date 2'
   
),
   array(
      
'title' => 'Another title' ,
      
'name' => 'Another Name 2' ,
      
'date' => 'Another date 2'
   
)
);

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

So you need an array in which each element is an array also. The second level contains the condition (produces "WHERE title='My title'") and the field names that must be updated, with the new values for each field.
Reply


Messages In This Thread
Update Batch - by sapurah - 09-14-2016, 01:00 AM
RE: Update Batch - by Wouter60 - 09-14-2016, 08:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB