Welcome Guest, Not a member yet? Register   Sign In
Model method not inserting data into database
#5

(This post was last modified: 08-26-2015, 10:12 PM by seasenx6.)

(08-26-2015, 05:43 AM)Avenirer Wrote: did you try this?


if($this->ion_auth->update($id, $data)) {
    $id = $this->ion_auth->user()->row()->id;
    $this->activity_model->log_activity($id, ' changed profile data.');
    redirect('user/profile','refresh');
}


(08-26-2015, 09:37 AM)cirox Wrote: Thanks Avenirer. I tried this, and I even passed a value instead of a variable for the $id, still nothing happens.

1. - $id = $this->ion_auth->user()->row()->id; <--- should return row_array();

example
PHP Code:
public function get_id ($username,... up to u) {
 
 $this->db->select('id');
 
 $this->db->from('table');
 
 $this->db->where('username'$username);
 
 $query $this->db->get();
 
 return $query->row_array(); //!important


2. - $this->activity_model->log_activity($id['id'], ' changed profile data.'); <--- using $id['id']; id is fied in database

still not happen again, ple check function in activity_model.
Reply


Messages In This Thread
RE: Model method not inserting data into database - by seasenx6 - 08-26-2015, 09:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB