When i tried using ( join ) statement for fetching data , sqlite3 tend to overwrite the column name if it appears in the other table
table-a
| ID |
Name |
Foreign_id |
| 1 |
bar |
2 |
table-b
When i try to join them
SELECT * FROM table-a a JOIN table-b b ON(a.foreign_id=b.id)
i get the result as follows
[
array(
'ID' => 2,
'name' => 'foo',
'foreign_id' => 2
)
]
i suggest prefixing the columns names with the table aliases name to clarify and avoid overwriting
So the result would be like this
[
array(
'a.ID' => 1,
'a.name' => 'bar',
'a.Foreign_id' => 2,
'b.ID' => 2,
'b.name' => 'foo'
)
]
thanks in advance