Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

codeigniter update or create

   $this->db->where('user_id',$id);
   $q = $this->db->get('profile');

   if ( $q->num_rows() > 0 ) 
   {
      $this->db->where('user_id',$id);
      $this->db->update('profile',$data);
   } else {
      $this->db->set('user_id', $id);
      $this->db->insert('profile',$data);
   }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #codeigniter #update #create
ADD COMMENT
Topic
Name
8+3 =