Answers for "insert id in library codeigniter"

PHP
2

last insert id model codeigniter

function add_post($post_data){
   $this->db->insert('posts', $post_data);
   $insert_id = $this->db->insert_id();

   return  $insert_id;
}
Posted by: Guest on September-01-2020
0

codeigniter 4 query builder get inserted id

$query = $this->db->table($this->table)->insert($data);
return $query->resultID;
Posted by: Guest on December-12-2020

Code answers related to "insert id in library codeigniter"

Browse Popular Code Answers by Language