1function add_post($post_data){
2 $this->db->insert('posts', $post_data);
3 $insert_id = $this->db->insert_id();
4
5 return $insert_id;
6}
1 $this->db->insert('posts', $post_data);
2 $insert_id = $this->db->insert_id();
3 return $insert_id;
1 $db = db_connect();
2 $query = $db->query("SELECT * FROM users ORDER BY id DESC LIMIT 1");
3 $result = $query->getRow();