Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. <style>
  7. table, th, td {
  8. border: 1px solid black;
  9. }
  10. </style>
  11. </head>
  12.  
  13. <?php
  14. include "coursedb.php";
  15. $sql="select * from coursetb";
  16. $results= mysqli_query($conn,$sql);
  17. if(!$results){
  18. echo mysqli_error($conn);
  19. exit();
  20. }
  21. ?>
  22. <body>
  23.  
  24. <table style="width:100%">
  25. <tr>
  26. <th>Course Name</th>
  27. <th>Price</th>
  28. <th>Description</th>
  29. <th>Course Duration(Days)</th>
  30. <th>Available Seats</th>
  31. </tr>
  32. <?php
  33. while ($row=mysqli_fetch_assoc($results)){
  34. echo "<tr><td>" . $row['coursename'] . "</td>";
  35. echo "<td>" . $row['price'] . "</td>";
  36. echo "<td>" . $row['description'] . "</td>";
  37. echo "<td>" . $row['courseduration'] . "</td>";
  38. echo "<td>" . $row['seats'] . "</td></tr>";
  39. }
  40. ?>
  41. </table>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement