Advertisement
Hydrase

Employee TABLE FORM

Jun 7th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Student Records</title>
  6. </head>
  7. <body>
  8. <?php
  9. $conn = mysqli_connect("localhost", "root", "", "COLLEGE");
  10. if ($conn->connect_error) {
  11. die("Connection Failed: " . $conn->connect_error);
  12. }
  13. echo "Connected successfully<br>";
  14. $sql="SELECT * FROM EMP";
  15. $result=mysqli_query($conn,$sql);
  16. if(mysqli_num_rows($result)>0)
  17. {
  18. echo"<table border='1'>
  19. <tr>
  20. <th>EMPNO</th>
  21. <th>ENAME</th>
  22. <th>MOBILE</th>
  23. <th>DOB</th>
  24. </tr>";
  25. while($row=mysqli_fetch_assoc($result)){
  26. echo"<tr>
  27. <td>".$row["EMPNO"]."</td>
  28. <td>".$row["ENAME"]."</td>
  29. <td>".$row["MOBILE"]."</td>
  30. <td>".$row["DOB"]."</td>
  31. </tr>";
  32. }
  33. echo"</table>";
  34. }
  35. else{
  36. echo"0 Results";
  37. }
  38. $conn->close();
  39. ?>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement