[eluser]bhbutter123[/eluser]
I have two tables, for the most part the joins I am performing are working great but one column is the same in both tables - the id column which is the primary key. When I join the two tables the id from one is overwriting the id from the other one. Here is my model's code:
function get(){
$this->db->select('*');
$this->db->from('ci_businesses');
$this->db->join('ci_users', 'ci_users.id=ci_businesses.owner_id');
$query = $this->db->get();
$result = array();
foreach($query->result_array() as $row){
$result['listings'][] = $row;
}
return $result;
}
Is there something I am doing wrong or something I can add to have both id columns kept?