daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Sep 24th, 2016 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <style>
  5. table, th, td {
  6.      border: 1px solid black;
  7. }
  8. </style>
  9. </head>
  10. <body>
  11.  
  12. <?php
  13. $servername = "localhost";
  14. $username = "root";
  15. $password = "";
  16. $dbname = "database";
  17.  
  18. // Create connection
  19. $conn = new mysqli($servername, $username, $password, $dbname);
  20. // Check connection
  21. if ($conn->connect_error) {
  22.      die("Connection failed: " . $conn->connect_error);
  23. }
  24.  
  25. $sql = "SELECT IP, Username, BannedBy, Reason FROM blacklist";
  26. $result = $conn->query($sql);
  27.  
  28. if ($result->num_rows > 0) {
  29.      echo "<table><tr><th>IP</th><th>Name</th><th>BannedBy</th><th>Reason</th><th>Date</th></tr>";
  30.      // output data of each row
  31.      while($row = $result->fetch_assoc()) {
  32.          echo "<tr><td>" . $row["IP"]. "</td><td>" . $row["Username"]. "</td><td>" . $row["BannedBy"]. "</td><td>" . $row["Reason"]. "</td><td>". $row["Date"]. "</td></tr>";
  33.      }
  34.      echo "</table>";
  35. } else {
  36.      echo "0 results";
  37. }
  38.  
  39. $conn->close();
  40. ?>  
  41.  
  42. </body>
  43. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top