RE: How do you get the last inserted ID in Codeigniter?

How do you get the last inserted ID in Codeigniter?

dip Team Leader Asked on June 7, 2018 in CODEIGNITER.
Add Comment
1 Answers
Try this One:

function add_user($user_data){
   $this->db->insert('user_master', $user_data);
   $insert_id = $this->db->insert_id();

   return  $insert_id;
}
Team Leader Answered on November 18, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.