I have 2 tables in my database which I need to join. 1 table is the artikelen table and the other one is the collecties table. I currently have.
$this->db->select('*');
$this->db->from('collecties');
$this->db->join('artikelen', 'artikelen.collecties_id = collecties.id');
It gives the right result but all the double fields (collecties has a title field and artikelen has a title field) will become one (it returns the artikelen.title field), and I can't access the row of the other table (the collecties.title field).
I select 10 fields from artikelen and only collecties.title from collecties.
What is the simples way to do this without having to replace
$this->db->select('*');
with all the 10 fields with an as statement.
not sure why its closed, related question is not related, this is not about the query but about codeignitor
...the underlying probably doesn't pertain to CodeIgniter, this is a misunderstanding about how to avoid column collisions. The fact that you encountered this common problem while using CodeIgniter makes this page a potentially valuable signpost for the dupe target which explains how to resolve the problem. – Nonfiction->get()
nor any result set forming method. Whatever new problem you are experiencing, it will not be resolved by the accepted answer if not also solved by the dupe targets. Your question is currently either a duplicate or Unclear. – Nonfiction