Advertisement
Guest User

Untitled

a guest
Apr 5th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.   <title>Faces Project</title>
  5.   <meta charset="utf-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1">
  7.   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  8.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  9.   <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  10. </head>
  11. <body>
  12.  
  13. <div class="container">
  14.   <h2>Face Detection and Data Store</h2>
  15.   <p>These are the records that are obtained from MySQL</p>            
  16.   <table class="table table-hover">
  17.     <thead>
  18.       <tr>
  19.         <th>FaceID</th>
  20.         <th>Confidence</th>
  21.         <th>Age</th>
  22.     <th>Neutral</th>
  23.     <th>Happiness</th>
  24.     <th>Surprise</th>
  25.     <th>Anger</th>
  26.     <th>Sadness</th>
  27.     <th>Positive</th>
  28.     <th>Time</th>
  29.     <th>Image</th>
  30.       </tr>
  31.     </thead>
  32.     <tbody>
  33.     <?php
  34.     $servername = "localhost";
  35.     $username = "zak";
  36.     $password = "lol123";
  37.     $dbname = "pi";
  38.  
  39.     // Creating Connection String
  40.  
  41.     $conn = new mysqli("localhost", "zak", "lol123", "pi");
  42.  
  43.     //Check Connection
  44.     if($conn->connect_error) {
  45.         die("Connection Failed: " . $conn->connect_error);
  46.     }
  47.     $sql = "SELECT * FROM faces ORDER BY FaceID DESC LIMIT 0, 1";
  48.     $result = mysqli_query($conn,$sql);
  49.     while($row = mysqli_fetch_assoc($result)){
  50.         echo "<tr>
  51.         <td>".$row['FaceID']."</td>
  52.         <td>".$row['Confidence']."</td>
  53.         <td>".$row['Age']."</td>
  54.         <td>".$row['Neutral']."</td>
  55.         <td>".$row['Happiness']."</td>
  56.         <td>".$row['Surprise']."</td>
  57.         <td>".$row['Anger']."</td>
  58.         <td>".$row['Sadness']."</td>
  59.         <td>".$row['Positive']."</td>
  60.         <td>".$row['Time']."</td>
  61.         <td><img src="/imgs/" /></td></tr>";
  62.     }
  63. ?>
  64.     </tbody>
  65.   </table>
  66. </div>
  67.  
  68. </body>
  69. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement