Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>DAW.org</title>
  6. </head>
  7. <body>
  8. <?php
  9. $servername = "localhost";
  10. $username = "root";
  11. $password = "9462";
  12. $dbname = "Prova";
  13.  
  14. // Create connection
  15. $conn = new mysqli($servername, $username, $password, $dbname);
  16. // Check connection
  17. if ($conn->connect_error) {
  18. die("Connection failed: " . $conn->connect_error);
  19. }
  20.  
  21. $sql = "SELECT id, pwd FROM Usuari";
  22. $result = $conn->query($sql);
  23.  
  24. if ($result->num_rows > 0) {
  25. // output data of each row
  26. while($row = $result->fetch_assoc()) {
  27. echo "id: " . $row["id"]. " - Password: " . $row["pwd"]."<br>";
  28. }
  29. } else {
  30. echo "0 results";
  31. }
  32. $conn->close();
  33. ?>
  34. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement