1
I wonder if you have any way to get the results of a separate select through php. I have two foreign keys in the same table, setting for the same place, they are Tj.fk_time_mandante and Tj.fk_time_visitante.
SELECT tt.ds_nome, tti.ds_nome
FROM tb_jogo AS tj INNER JOIN tb_time AS tt ON tj.fk_time_mandante = tt.id_time
INNER JOIN tb_time AS tti ON tj.fk_time_visitante = tti.id_time
I already used the mysql_fetch_array but it joins the tt.ds_name and Tti.ds_name, I wanted them to be inserted into separate variables Example:
while($row = mysql_fetch_array($sql)){
echo $row['ds_nome1']; <- para tt.ds_time da consulta
echo $row['ds_nome2']; <- para tti.ds_time da consulta
}
I already tested the query in the database, and returned the correct result. Note: I am not using any framework