Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Student Records</title>
- </head>
- <body>
- <?php
- $conn = mysqli_connect("localhost", "root", "", "COLLEGE");
- if ($conn->connect_error) {
- die("Connection Failed: " . $conn->connect_error);
- }
- echo "Connected successfully<br>";
- $sql="SELECT * FROM EMP";
- $result=mysqli_query($conn,$sql);
- if(mysqli_num_rows($result)>0)
- {
- echo"<table border='1'>
- <tr>
- <th>EMPNO</th>
- <th>ENAME</th>
- <th>MOBILE</th>
- <th>DOB</th>
- </tr>";
- while($row=mysqli_fetch_assoc($result)){
- echo"<tr>
- <td>".$row["EMPNO"]."</td>
- <td>".$row["ENAME"]."</td>
- <td>".$row["MOBILE"]."</td>
- <td>".$row["DOB"]."</td>
- </tr>";
- }
- echo"</table>";
- }
- else{
- echo"0 Results";
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement