I am trying to join two tables together using CodeIgniter. I used CodeIgniter user guide for help. I am having some issues where only one table\'s data is displayed and I d
function result_getall(){
$this->db->select('tblanswers.*,credentials.*');
$this->db->from('tblanswers');
$this->db->join('credentials', 'tblanswers.answerid = credentials.cid', 'left');
$query = $this->db->get();
return $query->result();
}
Try this in controller and see whats the result.Also,show us if you are getting any error and make sure there is data in your table :).
Controller
function getall(){
$this->load->model('result_model');
$data['query'] =$this->result_model->result_getall();
print_r($data['query']);
die();
$this->load->view('result_view', $data);
}