0
I need to perform a search in two different tables and give echo
in the results separately! I think it would be something more or less like this:
$consulta = "SELECT * FROM tabela1 T1 UNION (SELECT* FROM tabela2 T2)";
$con = mysqli_query ($db,$consulta);
while ($Dado = mysqli_fetch_array($con)) {
echo $DadosT1; // Aqui resultado da primeira tabela
echo $DadosT2; // Aqui resultado da segunda tabela
}
Can anyone enlighten me if this is possible and how it does?
Two different tables? when using UNION does not give, the tables must follow the same amount of fields and types ! but, which fields of Table 1 and the fields of table2?
– novic
There are several different fields between the two tables. Also, I needed to do this query in this way...
– Gustavo Oliveira