common functions
public function get_user_meta($userID,$metakey){ $this->db->where(['user_id'=>$userID,'key'=>$metakey]); $query = $this->db->get('user_meta'); if($query->num_rows()>0){ $row = $query->row(); return is_serial($row->value) ? unserialize($row->value) : $row->value ; } } public function update_user_meta($userID,$metakey,$metavalue){ $this->db->where(['user_id'=>$userID,'key'=>$metakey]); $query = $this->db->get('user_meta'); $metavalue = is_array($metavalue) ? serialize($metavalue) : $metavalue; if($query->num_rows()>0){ $this->db->update('user_meta',['value'=>$metavalue], 'user_id'=>$userID,'key'=>$metakey]); $row = $query->row(); return $row->id; }else{ $this->db->insert('user_meta',['value'=>$metavalue,'user_id'=>$userID,'key'=...