【发布时间】:2013-01-11 01:58:35
【问题描述】:
使用 codeigniter 活动记录语法将数据从一个表插入另一个表的语法是什么?我尝试了通常的 mysqli 查询并且它有效,但我想使用 CodeIgniter Active Record 语法来保持一致性。
我尝试使用这些 CodeIgniter Active Record 查询,但仍然没有运气:
function insert_into()
{
$this->db->insert('table1');
$this->db->set('to_column');
$this->db->select('from_column');
$this->db->from('table2');
}
【问题讨论】:
-
你想要什么?从 1 个表中选择然后插入另一个表?是吗?
-
是的,raheel,这就是我想要实现的目标。
-
下面的答案是对的,你可以这样做
标签: php mysql codeigniter