Advertisement
Hydrase

PRINT CONTENTS ONTO WEBPAGE

Mar 4th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7. <body>
  8. <?php
  9. $conn=mysqli_connect("localhost","root","","COLLEGE");
  10. if($conn->connect_error)
  11. {
  12. die("Connection Failed".$conn->connect_error);
  13. }
  14. echo "Connected successfully<br>";
  15. $sql="SELECT SID,NAME,EMAIL,FEES,DOB FROM STUDENT";
  16. $result=mysqli_query($conn,$sql);
  17. if(mysqli_num_rows($result)>0)
  18. {
  19. //Output data at each row
  20. while($row=mysqli_fetch_assoc($result))
  21. {
  22. echo "ID: ".$row["SID"]."Name: ".$row["NAME"]."Email: ".$row["EMAIL"]."FEES: ".$row["FEES"]."DOB: ".$row["DOB"]."<br>";
  23. }
  24. }
  25. else
  26. {
  27. echo"0 results";
  28. }
  29. $conn->close();
  30. ?>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement