0
Good evening guys, I need to link two tables and I’m not able to correct or find where I’m going wrong.
I have two tables:
Table 1: br_regiao | id - iduf - name - (1 , 1, Litoral)
Table 2: br_estado | id - nome - (1 - Santa Catarina)
Query: field name and iduf table br_region and field name table br_estado making a field echo br_estado.name and br_region.name
Error : Only shows the table field br_estado.name and in the field br_regiao.name nothing appears.
PHP Codigo
<tbody>
<?php
$query = mysqli_query($_mysqli,"select * from br_regiao inner join br_estado on br_regiao.iduf = br_estado.id order by br_regiao.id desc");
while ($categoria = mysqli_fetch_array($query,MYSQLI_ASSOC)) {
?>
<tr>
<td><?php echo $categoria['id']; ?></td>
<td><?php echo $categoria['br_estado.nome']; ?></td>
<td><?php echo $categoria['br_regiao.nome']; ?></td>
<td>
<a class="btn btn-primary btn-sm show-tooltip" title="Edit" href="<?php echo $URL_ADMIN; ?>regiao.php?id=<?php echo $categoria['.id']; ?>"><i class="fa fa-edit"></i></a>
<a class="btn btn-danger btn-sm show-tooltip" title="Delete" href="<?php echo $URL_ADMIN; ?>regiaoalt.php?id=<?php echo $categoria['id']; ?>"><i class="fa fa-trash-o"></i></a>
</td>
</tr>
<?php
}
?>
</tbody>
Thank you Fábio Jânio, your help solved my problem...
– Luis Esteban Pastén
Always available @Luisestebanpastén
– Fábio Jânio
Fabio can help me ? @Fábiojânio to solve an array problem, by your score you should understand... I don’t want to create another question, could you help me in this double on array ? https://answall.com/questions/248059/retornando-dados-vinculados
– user92870
Okay. From a look there, it looks like a fellow has already identified the problem. But I’ll follow the topic, anything depending on your feedback on the comrade’s response I try to help.
– Fábio Jânio