首页 > 解决方案 > 如何使用codeiginter插入数据?

问题描述

我是codeiginter的新手,如何使用codeiginter将数据插入表中

我的控制器代码;

$data = array(
        'subgrpname' => $this->input->post('subgrpname'),
        'grpname'=> $this->input->post('grpname'),
        'pltype'=> $this->input->post('pltype')
    );  

标签: codeigniter

解决方案


这是简单的形式使用互联网搜索它

$data = array(
            'subgrpname' => $this->input->post('subgrpname'),
            'grpname'=> $this->input->post('grpname'),
            'pltype'=> $this->input->post('pltype')
        );  
        $this->db->insert('tablename',$data);

推荐阅读