Advertisement
Guest User

Untitled

a guest
Apr 6th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <html>
  2. <body>
  3. <?php
  4. $servername = "localhost";
  5. $username = "root";
  6. $password = "";
  7. $database = "coursework";
  8. $mysqli = new mysqli($servername, $username, $password, $database);
  9. if ($mysqli->connect_error) {
  10. die("Connection failed: " . $conn->connect_error);
  11. }
  12. $query = "SELECT * FROM component_apn";
  13.  
  14.  
  15. echo '<table border="0" cellspacing="2" cellpadding="2">
  16. <tr>
  17. <td> <font face="Arial">ComponentNo</font> </td>
  18. <td> <font face="Arial">Description</font> </td>
  19.  
  20.  
  21. </tr>';
  22.  
  23. if ($result = $mysqli->query($query)) {
  24. while ($row = $result->fetch_assoc()) {
  25. $field1name = $row["ComponentNo"];
  26. $field2name = $row["Description"];
  27.  
  28.  
  29.  
  30. echo '<tr>
  31. <td>'.$field1name.'</td>
  32. <td>'.$field2name.'</td>
  33.  
  34.  
  35. </tr>';
  36. }
  37. $result->free();
  38. }
  39. ?>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement