How would i join information from tables if they have the same name but different values? i am trying to join the name column from the Players table but i am already using name from the Minigames table to join the names?
database tables and output is here: http://imgur.com/a/38VpP
[php]
<?php $servername = "localhost"; $username = "root"; $password = "root"; $dbname = "9606"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT PlayerStats.player_id, Minigames.minigame_id, PlayerStats.stat, Minigames.name, PlayerStats.value FROM PlayerStats INNER JOIN Minigames ON PlayerStats.minigame_id = Minigames.minigame_id"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "Game | Player | Stat | Value |
---|---|---|---|
".$row["name"]." | ".$row["player_id"]." | ".$row["stat"]." | ".$row["value"]." |