How to join two table in codegnaiter

Please log in or register to like posts.

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);

Reactions

0
0
0
0
0
0
Already reacted for this post.

Reactions

Leave a Reply

Your email address will not be published. Required fields are marked *