0
Well, I’m a beginner in php (although I’m trying to learn), and at the moment I’m stuck in my last step finishing a php file. I have a table called "Team", where there are columns called "ID" and "Name" and another table called "Recordbyopponent", where there is a column called "Oppid" that corresponds to the ID of the other table.
That’s my code that works normally
$sql = "SELECT * FROM `RecordByOpponent` WHERE `TeamID` = " . $TeamID . " ";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["OppID"]. "</td><td>" . $row["TotalWins"] . "</td><td>" . $row["TotalLosses"] . "</td><td>" . $row["Points"] . "</td></tr>";
}
echo "</table>";
} else { echo "0 results"; }
$conn->close();
?>
While my code works and I get the ID of the searched, I need to get the name of the Time and not the ID. The Ids in the two tables match.
How can it be solved? I can’t understand, even though I’m trying ...
make a
inner join
– Ricardo Pontual