Advertisement
Hydrase

Search Name.php

Jun 7th, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <html>
  2. <?php
  3. if(isset($_GET["tit"]))
  4. {
  5. $tit=$_GET["tit"];
  6.  
  7. $db=mysqli_connect("localhost","root","","BOOKS");
  8. $sql="select * from book_details where TITLE='$tit'";
  9. $result=mysqli_query($db,$sql);
  10. if(mysqli_num_rows($result)>0)
  11. {
  12. while($row=mysqli_fetch_assoc($result))
  13. {
  14. echo "<br>BOOK ID:".$row["BOOKID"];
  15. echo "<br>AUTHOR:".$row["AUTHOR"];
  16. echo "<br>TITLE:".$row["TITLE"];
  17. }
  18. }
  19. else
  20. {
  21. echo"<br>BOOK DETAILS DOES NOT EXIST!";
  22. }
  23. }
  24. ?>
  25. <body>
  26. <form action="<?php $_PHP_SELF ?>" method="GET">
  27. ENTER TITLE:<input type="text" name="tit"><br>
  28. <input type="submit" name="submit">
  29. </form>
  30. <a href="index.php">go back</a>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement