Advertisement
wunude0011

Table

Apr 5th, 2020
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Equipment data </title>
  5. <style>
  6.       table, th, td {
  7.       padding: 5px;
  8.       border: 1px solid black;
  9.       border-collapse: collapse;
  10.       }
  11.     </style>
  12.  
  13.  
  14. </head>
  15. <body>
  16.   <table>
  17.     <tr>
  18.     <th>Microphone_Audio_Kits</th>
  19.     <th>Microphone_Equip_Condition</th>
  20.     <th>Camera_Kits</th>
  21.     <th>Camera_Equip_Condition</th>
  22.     <th>Lighting_Kits</th>
  23.     <th>Lighting_Equp_Condition</th>
  24.     <th>Monitors_TriPods_Extras</th>
  25.     <th>Monitors_TriPods_Extras_Condition</th>
  26. </tr>
  27. <?php
  28. $conn = mysqli_connect('localhost','root','', 'working');
  29. if ($conn-> connect_error) {
  30.   die("Connection failed:" .$conn-> connect_error);
  31. }
  32.  
  33. $sql = "SELECT Microphone_Audio_Kits, Microphone_Equip_Condition, Camera_Kits, Camera_Equip_Condition, Lighting_Kits, Lighting_Equp_Condition, Monitors_TriPods_Extras, Monitors_TriPods_Extras_Condition FROM equipment
  34.  ";
  35. $result = $conn-> query($sql);
  36.  
  37. if ($result-> num_rows > 0) {
  38.  while ($row = $result-> fetch_assoc()) {
  39.   echo "<tr><td>".$row['Microphone_Audio_Kits']."</td><td>".$row['Microphone_Equip_Condition']."</td><td>".$row['Camera_Kits']."</td><td>".$row['Camera_Equip_Condition']."</td><td>".$row['Lighting_Kits']."</td><td>".$row['Lighting_Equp_Condition']."</td><td>".$row['Monitors_TriPods_Extras']."</td><td>".$row['Monitors_TriPods_Extras_Condition']."</td></tr>";
  40.  }
  41.  echo "</table>";
  42. }
  43. else {
  44.   echo "0 result";
  45. }
  46. ?>
  47.  
  48.   </table>
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement