Advertisement
Guest User

Untitled

a guest
Feb 26th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5. $dbname = "banlist";
  6.  
  7. // Create connection
  8. $conn = mysqli_connect($servername, $username, $password, $dbname);
  9. // Check connection
  10. if (!$conn) {
  11. die("Connection failed: " . mysqli_connect_error());
  12. }
  13.  
  14. $sql = "SELECT id, uuid FROM users";
  15. $result = mysqli_query($conn, $sql);
  16.  
  17. $id = $row["id"];
  18. $uuid = $row["uuid"];
  19.  
  20. if (mysqli_num_rows($result) > 0) {
  21. // output data of each row
  22. while($row = mysqli_fetch_assoc($result)) {
  23. echo $id + $uuid;
  24. }
  25. } else {
  26. echo "0 results";
  27. }
  28.  
  29. mysqli_close($conn);
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement