Controller
public function load_(){
$data_arrs = $this->input->post('id');//ค่าตัวนี้มาจาก Jquery เป็น Array ครับ
foreach ($data_arrs as $keys => $values) {
$result = $this->model_load->get_data($values);
}
$this->load->view('load'. $result);
}
Model
public function get_data($data_arrs){
$sql = "SELECT id FROM table WHERE id NOT IN (SELECT id FROM load WHERE id = '$data_arrs')";
$query = $this->db->query($sql);
return $query->result_array();
}
Controller
public function load_(){
$data_arrs = $this->input->post('id');//ค่าตัวนี้มาจาก Jquery เป็น Array ครับ
$data_arr = implode(array_filter($data_arrs), ',');
$result = $this->model_load->get_data($data_arr);
//foreach ($data_arrs as $keys => $values) {
//$result = $this->model_load->get_data($values);
//}
$this->load->view('load'. $result);
}
Model
public function get_data($data_arrs){
$sql = "SELECT id FROM table WHERE id NOT IN (SELECT id FROM load WHERE id = '$data_arrs')";
$query = $this->db->query($sql);
return $query->result_array();
}