开发者

CodeIgniter: getting the id of a newly created record

开发者 https://www.devze.com 2023-02-05 11:46 出处:网络
I\'m using the CXTags CI tagging library. The tag_ref table takes a row_id. So my posts can have multiple tags added to them. The method for adding tags takes the table and row_id of the entity being

I'm using the CXTags CI tagging library. The tag_ref table takes a row_id. So my posts can have multiple tags added to them. The method for adding tags takes the table and row_id of the entity being tagged. In my case the table is 'posts' and row_id would be the id of the posts record.

I want to do something like this:

$this->db->insert('posts', $_POST);
$this->CXTags->add_tags($data); //where data holds table name and row_id

Any hel开发者_如何学Pythonp most appreciated!

Billy


$this->db->insert_id()

You know the user guide is your friend.

0

精彩评论

暂无评论...
验证码 换一张
取 消