CodeIgniter-MY_Model
CodeIgniter-MY_Model copied to clipboard
Unknown column 'Array' in 'where clause'
hello im getting database error im trying to update where_id in array
UPDATE `brands` SET `status` = '1', `updated_at` = '2018-11-01 14:32:39'
WHERE `brands`.`id` IN(Array)
This my controller i have try
$id=$this->input->post('id');
and i have also try
$id= array('2','3');
and this my query
$query = $this->marques_model->where_id($id);
$query = $this->marques_model->update($data);
i have find the cause of problem you have to update my_model change
$this->_database->{$where_or.$not.'_in'}($this->table.'.'.$field_or_array, $operator_or_value);
by
$multi = $this->is_multidimensional($operator_or_value);
if($multi){
foreach($operator_or_value as $row_value){
$this->_database->{$where_or.$not.'_in'}($this->table.'.'.$field_or_array, $row_value);
}
}else{
$this->_database->{$where_or.$not.'_in'}($this->table.'.'.$field_or_array, $operator_or_value);
}