5
I am creating a 2014 World Cup table.
I created two tables.
times (ID, nome, sigla, bandeira)
jogos (ID, fase, local, time1_id, time2_id, data)
I have a relatively simple problem, but I found no solution researching... I want to make a Select to bring me the name of time1 and of time2 in a consultation, replacing the ID
.
SELECT `jogos`.*, `time`.`nome` FROM `jogos`
INNER JOIN `time` ON `jogos`.`time1_id` = `time`.`id` AND `jogos`.`time2_id` = `time`.`id`
I need to know how to pull the name of time1 and of time2 through the ID
..
I could do some PHP hacking, like a string replace, but I would like to pull the table times the names.
How can I do that?
That’s exactly what I was missing.. I did not know I had to do so, I had never fallen in this situation, I thank you very much for the knowledge you brought me. Solved!!
– Luther
@Luther That’s it, programming and learning :)
– abfurlan