0
I have a question in a select with the use of Join in codeigniter, follows:
I have 2 tables.
tabela jogo
id | id_time1 | id_time2
99 | 1 | 2
tabela time
id | time
1 | Real
2 | Barcelona
I want to return the teams to mount a confrontation: Real x Barcelona
My select is like this:
$this->db->select('jogo.*, time.time AS time_nome1, time.time AS time_nome2');
$this->db->from('jogo');
$this->db->join('time', 'time.id = jogo.id_time1');
This way I can return the team 1 but not the team 2 or vice versa, changing the Join to id_time2
How I do with Join to return the two teams?
Thanks in advance
Exactly that, it worked. I looked for everything and had no idea it was that simple. Thank you very much!
– Flybow