sql >> Database >  >> RDS >> Mysql

php met mysql-gegevens in html-tabel in kolommen en rijen

Je moet een JOIN . gebruiken , in de trant van:

$result = mysqli_query($conn,"SELECT player.*, score.* FROM player LEFT JOIN score ON score.playerid = player.playerid ");

echo "<table>
<tr>
<th>Name</th>
<th>Last Name</th>
<th>Score</th>
</tr>";

while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['lastname'] . "</td>";
echo "<td>" . $row['score'] . "</td>";
echo "</tr>";
}
echo "</table>";


  1. PostgreSQL INSERT FROM SELECT met extra kolom

  2. Hoe performance_schema-statistieken te wissen zonder MySQL opnieuw te starten?

  3. update unieke geïndexeerde kolom in mysql

  4. MP4-bestandstags ophalen