public function set_user_profile_data($username, $fields = NULL) { $custom_model = new Custom_model(); $records = $custom_model->get_user_profile_data($username, $fields); if (!empty($records)) { $this->ci->redis->hSet('user_profile', $records['user_username'], json_encode($records)); } return $records; }