Guest User

Untitled

a guest
Jun 11th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "root";
  5. $dbName = "test";
  6.  
  7. //make a connection
  8. $connection = new mysqli($servername, $username, $password, $dbName);
  9.  
  10. //Check the connection
  11. if(!$connection)
  12. {
  13. die("Connection Failed".mysqli_connect_error());
  14. }
  15.  
  16. $sql = "SELECT userid, username, email, age, level, lastgame, gameswon, kills, deaths, winnings, password FROM users";
  17. $result = mysqli_query($connection, $sql);
  18.  
  19. if(mysqli_num_rows($result)){
  20. while(mysqli_fetch_assoc($result)){
  21. echo "ID:" .$row['userid'] . "|Username" .$row['username'] . "|Email" .$row['email'] . "|Age" .$row['age'] . "|Level" .$row['level'] . "|LastGame" .$row['lastgame'] . "|GamesWon" .$row['gameswon'] . "|Kills" .$row['kills'] . "|Deaths" .$row['deaths'] . "|Winnings" .$row['winnings'] . "|Password" .$row['password'] .';';
  22. }
  23. }
  24. ?>
Add Comment
Please, Sign In to add comment