1
I have two tables that are:
Registration
- Dorsal(id auto_increment Primary key);
- Name;
- Team;
Classification
- Place(id auto_increment Primary key);
- Dorsal (Foreign key);
and the following code in PHP:
$result = mysqli_query($con,"SELECT c.lugar, c.dorsal, r.nome, r.equipa from classificacao c, registo r where c.dorsal = r.dorsal and r.categoria = '45'");
while($row = mysqli_fetch_array($result)){
echo "<tr>";
echo "<td>" . $row['lugar'] . "</td>";
echo "<td>" . $row['dorsal'] . "</td>";
echo "<td>" . $row['nome'] . "</td>";
echo "<td>" . $row['equipa'] . "</td>";
echo "</tr>";
}
This works well without the place, just by selecting the data from the record table but so it is not working. Does anyone know why?
The table where the place field is called "Place"?
– Hélder
@Hélder No, I’m sorry it’s already mended and thank you
– Bruno Gibellino
Can you put a sample of the data from the two tables? And are you sure there is a record in the record table with category = 45?
– bruno