Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Apr 6, 2018 5:27 AM
Views: 12
Tags: record update
  1. $data = array(
  2.         'title' => $title,
  3.         'name' => $name,
  4.         'date' => $date
  5. );
  6.  
  7. $this->db->where('id', $id);
  8. $this->db->update('mytable', $data);
  9. // Produces:
  10. //
  11. //      UPDATE mytable
  12. //      SET title = '{$title}', name = '{$name}', date = '{$date}'
  13. //      WHERE id = $id