I have two tables that are:
-
Registration
- Dorsal (id auto_increment primary key);
- Name;
- Team;
-
Classification
- Location (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 fine without the place, just selecting the data from the record table but that is not working. Does anyone know why?