Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Hostel Menagment System</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="style.css">
- <style>
- th,td
- {
- color:white;
- }
- div
- {
- border:10px;
- }
- </style>
- <div><button><a href="index.html">Back to form</a></button></div>
- </head>
- <body>
- <?php
- $servername="localhost";
- $username="root";
- $password="";
- $dbname="hostel";
- $conn=new mysqli($servername,$username, $password,$dbname);
- if($conn->connect_error)
- {
- die("connectionfailed:".$conn->connect_error);
- }
- $sql = "SELECT * FROM details";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- echo "
- <table class='table table-striped'>
- <thead>
- <tr>
- <th>S. No.</th>
- <th>Name</th>
- <th>E-Mail</th>
- <th>Roll no.</th>
- <th>Hostel Name</th>
- <th>Hostel No.</th>
- <th>Room No.</th>
- <th>Year</th>
- <th>Branch</th>
- <th>Gender</th>
- <th>Warden Name</th>
- </tr>
- </thead>
- <tbody>";
- while($row = $result->fetch_assoc()) {
- echo"
- <tr>
- <td>".$row["id"]."</td>
- <td>".$row["Name"]."</td>
- <td>".$row["Email"]."</td>
- <td>".$row["Roll_no"]."</td>
- <td>".$row["Hostel_Name"]."</td>
- <td>".$row["Hostel_No"]."</td>
- <td>".$row["RoomNo"]."</td>
- <td>".$row["Year"]."</td>
- <td>".$row["Branch"]."</td>
- <td>".$row["Gender"]."</td>
- <td>".$row["Warden_Name"]."</td>
- </tr>";
- }
- echo "
- </tbody>
- </table>
- </div>
- ";
- }
- ?>
Add Comment
Please, Sign In to add comment