How to join two table in codegnaiter

1 model )

$this->db->select('*');
$this->db->from('testing');
$this->db->join('tb1','tb1.id=testing.id');
$this->db->where('tb1.id =  ','1');
$data=$this->db->get();
$query= $data->result_array();
return $query;


2 Controller)


$this->load->model('index_model');
$query=$this->index_model->get_post();
$data1['post'] = $query;
// print_r($data1);
$this->load->view('home',$data1);

No comments