0
I have two tables: one that registers the games of the round and the other that registers the guesses for these games. I want to show a table where the Game appears, the user’s guess X and if it has already been played, its result as well. At the moment, the solution I found is the following:
I select all the games of round X. Then I do a while and within it I make a new selection to find the guess of that user. It’s working normally, but I’m afraid there’s something wrong with the large amount of queries being made. If a round has 16 games, I select once all of her games + 16 selections from each guess. That’s the other page queries. Is there a more streamlined solution? It is possible with two selects to just pick up all necessary information?
Edit:
There are 2 tables relevant to this question:
Table Games: id - timecasa - timefora - result
Tabela Palpites:
id - idjogo (same as table id games) - idusuario (from whom you guessed) - choose (whether you chose home or away team) - result
What do you want is a JOIN, the guesses are from all users or just one? Put your bank structure, where are the results?
– Costamilam