I'm having a doubt on a select with the use of join in codeigniter, it 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 teams to set up a showdown: Real x Barcelona
My select looks 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 team 1 but not team 2 or vice versa by changing the join to juego.id_time2
How do I join to return both teams?
Thanks in advance