I want to display my data from database into select2 server side, I want to combine my table into one with same field but failed, this is my model:
$json = [];
if (!empty($this->input->get("q"))) {
$this->db->like('nama', $this->input->get("q"));
$query = $this->db->select('idmuzakki as id,nama as text')
->limit(10)
->get("muzakki");
$query = $this->db->select('idcorporate as id, nama as text')
->limit(10)
->get("corporate");
$json = $query->result();
}
echo json_encode($json);
How can I combine 2 table into 1 result with same field (as id and as text) for select2 server side?