Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.47 KB | None | 0 0
  1. <?php
  2.  
  3. $yn;
  4. mysql_connect("localhost", "root", "jack24") or die(mysql_error());
  5. mysql_select_db("mcv") or die(mysql_error());
  6.  
  7. $result = mysql_query("SELECT * FROM Codes")
  8. or die(mysql_error());  
  9.  
  10. $row = mysql_fetch_array( $result );
  11. // Print out the contents of the entry
  12.  
  13. if ($row['Used'] == 1) {
  14.     $yn = "Yes";
  15. }
  16. else{
  17.     $yn = "No";
  18. }
  19.  
  20. ?>
  21.  
  22. <html>
  23. <head>
  24.     <title>Minecraft Codes</title>
  25.     <style type="text/css">
  26.  
  27.     tbody {
  28.         display: table-row-group;
  29.         vertical-align: middle;
  30.         border-color: inherit;
  31.     }
  32.  
  33.     tr {
  34.         display: table-row;
  35.         vertical-align: inherit;
  36.         border-color: inherit;
  37.     }
  38.  
  39.     th {
  40.         border: 1px solid #C3C3C3;
  41.         padding: 3px;
  42.         vertical-align: top;
  43.         width: 20%;
  44.         background-color: #E5EECC;
  45.     }
  46.  
  47.     table.reference {
  48.         background-color: white;
  49.         border: 1px solid #C3C3C3;
  50.         border-collapse: collapse;
  51.         width: 50%;
  52.     }
  53.  
  54.     table.reference td {
  55.         border: 1px solid #C3C3C3;
  56.         padding: 3px;
  57.         vertical-align: top;
  58.         width: 20%;
  59.     }
  60.  
  61.     table, th, td, input, textarea {
  62.         font-size: 100%;
  63.     }
  64.  
  65.     body, p, h1, h2, h3, h4, table, td, th, ul, ol, textarea, input {
  66.         font-family: verdana,helvetica,arial,sans-serif;
  67.     }
  68.  
  69.     </style>
  70. </head>
  71.  
  72. <body>
  73.     <center>
  74.         <br />
  75.         <h1><u>Minecraft Server VIP Codes</u></h1>
  76.         <br />
  77.        
  78.         <table class="reference">
  79.             <tr>
  80.                 <th>Code</th>
  81.               <th>Used?</th>
  82.           </tr>
  83.           <?php echo "<tr><td>".$row['Code']."</td><td>".$yn."</td></tr>"; ?>
  84.         </table>
  85.     </center>
  86. </body>
  87. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement