Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- <style>
- table, th, td {
- border: 1px solid black;
- }
- </style>
- </head>
- <?php
- include "coursedb.php";
- $sql="select * from coursetb";
- $results= mysqli_query($conn,$sql);
- if(!$results){
- echo mysqli_error($conn);
- exit();
- }
- ?>
- <body>
- <table style="width:100%">
- <tr>
- <th>Course Name</th>
- <th>Price</th>
- <th>Description</th>
- <th>Course Duration(Days)</th>
- <th>Available Seats</th>
- </tr>
- <?php
- while ($row=mysqli_fetch_assoc($results)){
- echo "<tr><td>" . $row['coursename'] . "</td>";
- echo "<td>" . $row['price'] . "</td>";
- echo "<td>" . $row['description'] . "</td>";
- echo "<td>" . $row['courseduration'] . "</td>";
- echo "<td>" . $row['seats'] . "</td></tr>";
- }
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement