Advertisement
Guest User

Untitled

a guest
May 8th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "rustopsc_root";
  4. $password = "sV@3g%3WmTrg";
  5. $dbname = "rustopsc_root";
  6.  
  7.  
  8. // Create connection
  9. $conn = new mysqli($servername, $username, $password, $dbname);
  10. // Check connection
  11. if ($conn->connect_error) {
  12. die("Connection failed: " . $conn->connect_error);
  13. }
  14.  
  15. $sql = "SELECT id, purchaser, username, value, rank, time FROM transactions";
  16. $result = $conn->query($sql);
  17.  
  18. if ($result->num_rows > 0) {
  19. echo "<table><tr><th>--------Purchaser--------</th><th>--------Value--------</th><th>--------SteamID 64--------</th><th>--------Date Purchased--------</th></tr>";
  20. // output data of each row
  21. while($row = $result->fetch_assoc()) {
  22. echo "<tr><td>".$row["purchaser"]."</td><td>".$row["username "]." ".$row["value"]."</td><td>".$row[""]." ".$row["username"]."</td><td>".$row[""]." ".$row["time"]."</td></tr>";
  23. }
  24. echo "</table>";
  25. } else {
  26. echo "0 results";
  27. }
  28. $conn->close();
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement