Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function create_user($data, $activated = TRUE)
- {
- $data['created'] = date('Y-m-d H:i:s');
- $data['activated'] = $activated ? 1 : 0;
- if ($this->db->insert($this->table_name, $data))
- {
- $user_id = $this->db->insert_id();
- if ($activated) $this->create_profile($user_id, $data);
- eturn array('user_id' => $user_id);
- }
- return NULL;
- }
- private function create_profile($user_id, $data)
- {
- $this->db->set('user_id', $user_id);
- $this->db->set('first_name', $data['first_name']);
- $this->db->set('last_name', $data['last_name'] );
- return $this->db->insert($this->profile_table_name);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement