1
I am making the following query to my database:
$escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE
e.rodada = ('.$rodada_atual.' - 0) AND jr.rodada = '.$rodada_atual;
$escalacoes = $pdo->query($escalacoes);
$escalacoes->execute();
while ($dadoEscalacao = $escalacoes->fetch(PDO::FETCH_ASSOC)){
echo $dadoEscalacao['rodada'];
echo "<br>";
}
- The "$rodada_actual" is set elsewhere
- That "-0" is just because in my test I have to use it like this
When I print in php the round, it takes the table value from left (in the case, the table 'escalations'). Since I have a column with the same name in the other table ('round'). Can I print the value of the right table in php itself?
Obs: I know I don’t need this, since I’m determining the value of the round in the sql query, but I was wondering if it is possible to do this.
https://stackoverflow.com/questions/9122/select-all-columns-except-one-in-mysql take a look here, maybe select without counting the column with the same name q vc don’t want to solve
– Wees Smith