I'm trying to fetch some value's from a database. The database contains 2 tables, when i try to join the data i get nothing, no output on screen , no text on screen.
when i do the query for each, it works. now i tried several examples but nothing works....i just don't get it !?
This is the code:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <table width="600" height="100" border="1"> <tr style="color:#00CC00"> <th width="50"></th> <th width="200">Player Name:</th> <th width="50">Player Online:</th> <th width="100">EXP Total</th> <th width="300">Player Playtime:</th> </tr> <?php $servername = ""; $username = ""; $password = ""; $dbname = ""; $port = ""; // Create connection $conn = new mysqli($servername, $username, $password, $dbname, $port); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT a.player_id, a.online, a.playtime, a.name, b.exp_total"; "FROM stats_players a, stats_misc_info_players b"; "where a.player_id=b.exp_total"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { ?> <tr style="color:#CCCCCC"> <td width="50"><?php echo $row["player_id"];?></td> <td width="200"><?php echo $row["name"];?></td> <td width="50"><?php echo $row["online"];?></td> <td width="100"><?php echo $row["exp_total"];?></td> <td width="300"><?php echo $row["playtime"];}} $conn->close() ?></td> </tr> </table> </body> </html>