CodeIgniter join two tables

后端 未结 2 1655
情深已故
情深已故 2021-01-16 10:24

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

2条回答
  •  时光取名叫无心
    2021-01-16 11:10

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

提交回复
热议问题