Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php
- if(isset($_GET["tit"]))
- {
- $tit=$_GET["tit"];
- $db=mysqli_connect("localhost","root","","BOOKS");
- $sql="select * from book_details where TITLE='$tit'";
- $result=mysqli_query($db,$sql);
- if(mysqli_num_rows($result)>0)
- {
- while($row=mysqli_fetch_assoc($result))
- {
- echo "<br>BOOK ID:".$row["BOOKID"];
- echo "<br>AUTHOR:".$row["AUTHOR"];
- echo "<br>TITLE:".$row["TITLE"];
- }
- }
- else
- {
- echo"<br>BOOK DETAILS DOES NOT EXIST!";
- }
- }
- ?>
- <body>
- <form action="<?php $_PHP_SELF ?>" method="GET">
- ENTER TITLE:<input type="text" name="tit"><br>
- <input type="submit" name="submit">
- </form>
- <a href="index.php">go back</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement