×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 30, 2018 6:11 AM
Modified: Apr 1, 2018 9:32 AM
Views: 11
  1. $query = $this->MODELNAME_model->find_by('id', $seller_id);
  2. $insert_data = array();
  3. if ( $query !== FALSE ){//exist
  4.         $this->db->set($insert_data);
  5.      $this->MODELNAME_model->update_where('id', $seller_id, $insert_data);
  6.  
  7. }
  8. else {//not exist
  9.         $this->db->set($insert_data);
  10.       $this->MODELNAME_model->insert($insert_data);
  11. }