Advertisement
Guest User

Untitled

a guest
Jan 8th, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <link rel="stylesheet" type="text/css" href="/css/table.css">
  5.         <script src='/scripts/table.js' type='text/javascript'></script>
  6.     </head>
  7.     <body>
  8.         <div class="table--class" style="width:50%;">
  9.             <table>
  10.                 <thead>
  11.                     <tr>
  12.                         <th>Priority</th>
  13.                         <th>Event</th>
  14.                         <th>Source</th>
  15.                         <th>Date</th>
  16.                         <th>Time</th>
  17.                     </tr>
  18.                 </thead>
  19.                 <tbody>
  20.                     <?php
  21.                         $connection = mysql_connect('localhost', 'root', 'mypass');
  22.                         mysql_select_db('log');
  23.  
  24.                         $query = "SELECT * FROM `Logs`";
  25.                         $result = mysql_query($query);
  26.                        
  27.                         while($row = mysql_fetch_array($result)){
  28.                             echo "<tr>";
  29.                                 echo "<td>".$row['severity']."</td>";
  30.                                 echo "<td>".$row['event']."</td>";
  31.                                 echo "<td>".$row['source']."</td>";
  32.                                 echo "<td>".$row['time']."</td>";
  33.                                 echo "<td>".$row['date']."</td>";      
  34.                             echo "</tr>";
  35.                         }
  36.  
  37.                         mysql_close();
  38.                     ?>
  39.                 </tbody>
  40.             </table>
  41.         </div>
  42.     </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement