I have two tables say Table1 and Table2 and i am Left joining Table1 on Table2 with Table1.PrimaryKey = Table2.ForeignKey. It does return all the rows from both tables but in some rows, due to no record in Table2 for the join condition, the PrimaryKey field value is missing for Table1. Here is my code
$this->db->select('*');
$this->db->from('CI_Articles_Tbl');
$this->db->join('CI_Article_Images_Tbl',
'CI_Articles_Tbl.roflArticle_ID=CI_Article_Images_Tbl.roflArticle_ID','left');
$this->db->group_by('CI_Articles_Tbl.roflArticle_ID');
$query = $this->db->get();
return $query->result_array();
What is the problem in my query and what is its possible solution. Any help will be highly appreciated.