Advertisement
humpda

Insert_Table

Apr 25th, 2022
1,481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.     $conn = new mysqli("localhost","fcac","wondunna","fcac_Student") or die(mysqli_error($conn));
  3.     if (isset($_POST["submit"])) {
  4.         $Surname = $_POST["Surname"];
  5.         $Given_Name = $_POST ["Given_Name"];
  6.         $query = mysqli_query($conn, "INSERT INTO Student (Surname, Given_Name) VALUES ('$Surname', '$Given_Name')") or die(mysqli_error($conn));
  7.    
  8.         if ($query) {
  9.         echo "Data entered successfully <BR>";
  10.         }
  11.        
  12.     }
  13.    
  14.  
  15.    
  16. mysqli_close($conn)
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement