Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <?php
- if(isset($_GET["bid"]) || isset($_GET["auth"]) || isset($_GET["tit"]))
- {
- $bid=$_GET["bid"];
- $auth=$_GET["auth"];
- $tit=$_GET["tit"];
- $db=mysqli_connect("localhost","root","","BOOKS");
- $sql="insert into book_details(BOOKID,AUTHOR,TITLE) values($bid,'$auth','$tit')";
- if($db->query($sql)===TRUE)
- {
- echo"<br>Record inserted successfully!";
- }
- else
- {
- echo"<br>Error: ".$sql."<br>".$db->error;
- }
- }
- ?>
- <body>
- <form action="<?php $_PHP_SELF ?>" method="GET">
- BOOK ID:<input type="int" name="bid"><br>
- AUTHOR:<input type="text" name="auth"><br>
- 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