Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我能';t将multiselect jquery值插入数据库_Jquery_Codeigniter 2_Multi Select - Fatal编程技术网

我能';t将multiselect jquery值插入数据库

我能';t将multiselect jquery值插入数据库,jquery,codeigniter-2,multi-select,Jquery,Codeigniter 2,Multi Select,我使用jquerymultiselect来显示我的数据 这就是我在视图上显示数据的方式 您的保存方法应如下所示: function save(){ //echo "<pre>"; //print_r($this->input->post()); //first try to check whether you are receiving posted data or not. //die; $id_c= $this->i

我使用jquerymultiselect来显示我的数据

这就是我在视图上显示数据的方式




您的保存方法应如下所示:

function save(){    
    //echo "<pre>";
    //print_r($this->input->post()); //first try to check whether you are receiving posted data or not.
    //die;

    $id_c= $this->input->post('id_c');
    $idb = implode(',', $id_c);
    $tanggal = $this->input->post('tanggal');
        $data=array(
                    'id_c'=>$idb,
                    'tanggal'=>$tanggal
                    );
        $this->db->insert('detail', $data);
}
函数save(){
//回声“;
//print_r($this->input->post());//首先尝试检查是否正在接收已发布的数据。
//死亡;
$id_c=$this->input->post('id_c');
$idb=内爆(',',$id_c);
$tanggal=$this->input->post('tanggal');
$data=数组(
'id_c'=>idb美元,
“tanggal”=>$tanggal
);
$this->db->insert('detail',$data);
}

您的保存方法应该如下所示:

function save(){    
    //echo "<pre>";
    //print_r($this->input->post()); //first try to check whether you are receiving posted data or not.
    //die;

    $id_c= $this->input->post('id_c');
    $idb = implode(',', $id_c);
    $tanggal = $this->input->post('tanggal');
        $data=array(
                    'id_c'=>$idb,
                    'tanggal'=>$tanggal
                    );
        $this->db->insert('detail', $data);
}
函数save(){
//回声“;
//print_r($this->input->post());//首先尝试检查是否正在接收已发布的数据。
//死亡;
$id_c=$this->input->post('id_c');
$idb=内爆(',',$id_c);
$tanggal=$this->input->post('tanggal');
$data=数组(
'id_c'=>idb美元,
“tanggal”=>$tanggal
);
$this->db->insert('detail',$data);
}

尝试使用print\r()函数打印
$this->input->post()
,并检查是否正在获取发布的数据。应用于select元素的jQuery/JS代码在哪里?我使用jQuery multiselect,将其放在我的中,并在我的表单class=“multiselect”中调用它,尝试使用print\r()打印
$this->input->post()
函数并检查您是否正在获取发布的数据。应用于select元素的jQuery/JS代码在哪里?我使用jQuery multiselect,我只是将它放在我的中,并以我的形式调用它class=“multiselect”我尝试了您的代码,我发现此错误列“id\u c”不能为null插入
详细信息中(
id\u c
tanggal
)值(NULL,0)我得到这个数组([simpan]=>simpan)你有没有意识到你正在尝试获取
$this->input->post('id\u c')
$this->input->post('tanggal'))
并且它不存在。您的html可能有问题。请检查并验证。我尝试了您的代码,发现此错误列“id_c”不能为null插入
详细信息
id_c
tanggal
)值(null,0)我得到此数组([simpan]=>simpan)您是否意识到您正在尝试获取
$this->input->post('id_c')
$this->input->post('tanggal')
,但它不存在。您的html可能有问题。请检查并验证。
function save(){    
    //echo "<pre>";
    //print_r($this->input->post()); //first try to check whether you are receiving posted data or not.
    //die;

    $id_c= $this->input->post('id_c');
    $idb = implode(',', $id_c);
    $tanggal = $this->input->post('tanggal');
        $data=array(
                    'id_c'=>$idb,
                    'tanggal'=>$tanggal
                    );
        $this->db->insert('detail', $data);
}