How to separate two columns with the same name while using JOIN LEFT?
13:56 15 Aug 2013

MySQL table looks like this:

markers
id, tid,        lat,    lng
1   1           42.000  2.500
2   1           41.000  2.400
3   2           40.000  2.300

markers_types
id, name,   image
1   TYPE1   type1.png
2   TYPE2   type2.png

While using CodeIgniter's Active Records:

function get_coordinates(){

    $this->db->select('*');
    $this->db->from('markers');
    $this->db->join('markers_types', 'markers.tid = markers_types.id');
    $this->db->where('state', 1);
    $query = $this->db->get();

    if( $query->result() < 1 ) return FALSE;

    $results = $query->result();
    return $results;

}

It concatenate (or merge) two columns named id into the one, from two different tables. How to prevent that? And is it possible to prevent from merging these columns without renaming them ?

php codeigniter query-builder codeigniter-2 name-collision