Advertisement
Hydrase

Search Siva

Jun 2nd, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9. <?php
  10. $ser=$_POST['s'];
  11. $conn=mysqli_connect('localhost','root',"","COLLEGE1");
  12. if($conn->connect_error)
  13. {
  14. die("connection succesfull".$conn->connect_error);
  15. }
  16. $sql="SELECT * FROM student where admno='$ser'";
  17. $res=$conn->query($sql);
  18. $c=0;
  19. while($row=mysqli_fetch_array($res))
  20. {
  21. $c++;
  22. echo "search successfull!!!<br><br><br>";
  23. echo "the details of the students are:";
  24. echo "student admno: ",$row[0]."<br>";
  25. echo "name: ".$row[1]."<br>";
  26. echo "dob: ".$row[2]."<br>";
  27. echo "gender: ".$row[3]."<br>";
  28. echo "Email: ".$row[4]."<br>";
  29. echo "Phone: ".$row[5]."<br>";
  30. }
  31. if(!$c)
  32. {
  33. echo "no results found:";
  34. }
  35. $conn->close();
  36. ?>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement