在CodeIgniter中是否有获取新记录的最后一个插入id的选项?
$last_id = $this->db->insert('tablename',
array('firstcolumn' => 'value',
'secondcolumn' => 'value')
);
考虑到表由字段id(自动增量)firstcolumn和secondcolumn组成.
这样,您就可以在下面的代码中使用insert id.
在CodeIgniter中是否有获取新记录的最后一个插入id的选项?
$last_id = $this->db->insert('tablename',
array('firstcolumn' => 'value',
'secondcolumn' => 'value')
);
考虑到表由字段id(自动增量)firstcolumn和secondcolumn组成.
这样,您就可以在下面的代码中使用insert id.