[Datatables joining tables search and order stuck with codeigniter
the case is the same at this link, see the correct answer, but why can't it be given "where"?
private function _get_datatables_query($term=''){ //term is value of $_REQUEST['search']['value']
$column = array('k.id_kota','k.nm_kota', 'p.nm_propinsi');
$this->db->select('k.id_kota, k.nm_kota, p.nm_propinsi');
$this->db->from('kota as k');
$this->db->where('k.id_kota',2); //this problem
$this->db->join('propinsi as p', 'p.id_propinsi = k.id_propinsi','left');
$this->db->like('k.id_kota', $term);
$this->db->or_like('k.nm_kota', $term);
$this->db->or_like('p.nm_propinsi', $term);
if(isset($_REQUEST['order'])) // here order processing
{
$this->db->order_by($column[$_REQUEST['order']['0']['column']], $_REQUEST['order']['0']['dir']);
}
else if(isset($this->order))
{
$order = $this->order;
$this->db->order_by(key($order), $order[key($order)]);
}
}
I will showing all data basic id.kota = 2 but can't. Please help. Thanks