Advertisement
Godleydemon

test.php

Dec 31st, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <!doctype html>
  2.     <html lang="en">
  3.     <head>
  4.       <meta charset="UTF-8">
  5.       <title>Infraction Test</title>
  6.     </head>
  7.     <body>
  8.       <?php
  9.       $username = "Utilisals";
  10.       $password = "██████████████";
  11.       $host = "localhost";
  12.  
  13.       $connector = mysql_connect($host,$username,$password)
  14.           or die("Unable to connect");
  15.         echo "Connections are made successfully::";
  16.       $selected = mysql_select_db("test_db", $connector)
  17.         or die("Unable to connect");
  18.  
  19.       //execute the SQL query and return records
  20.       $result = mysql_query("SELECT * FROM Bans ");
  21.       ?>
  22.       <table border="2" style= "background-color: #84ed86; color: #761a9b; margin: 0 auto;" >
  23.       <thead>
  24.         <tr>
  25.           <th>Number</th>
  26.           <th>Banned</th>
  27.           <th>Reason</th>
  28.           <th>Banned By</th>
  29.           <th>Time</th>
  30.         </tr>
  31.       </thead>
  32.       <tbody>
  33.         <?php
  34.           while( $row = mysql_fetch_assoc( $result ) ){
  35.             echo
  36.             "<tr>
  37.              <td>{$row\['Number'\]}</td>
  38.              <td>{$row\['Banned'\]}</td>
  39.              <td>{$row\['Reason'\]}</td>
  40.              <td>{$row\['BannedBy'\]}</td>
  41.              <td>{$row\['BanTime'\]}</td>
  42.            </tr>\n";
  43.           }
  44.         ?>
  45.       </tbody>
  46.     </table>
  47.      <?php mysql_close($connector); ?>
  48.     </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement