Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "bit2018";
- //create connection
- $conn = mysqli_connect($servername,$username,$password,$dbname);
- //check connection
- if(!$conn)
- {
- die("connection failed: " . mysqli_connect_error());
- }
- if(isset($_POST['submitbtn']))
- {
- $std_fname = $_POST['std_fname'];
- $std_lname = $_POST['std_lname'];
- $std_roll = $_POST['std_roll'];
- $std_contact = $_POST['std_contact'];
- $std_address = $_POST['std_sddress'];
- $sqlQuery = "INSERT INTO student_3rd (std_fname,std_lname,std_roll,std_contact,std_address)
- VALUES ('$std_fname','$std_fname','$std_roll','std_contact','$std_address')";
- if(mysql_query($conn,$sqlQuery))
- {
- $msg = "Information Inserted Succesfully";
- }
- else
- {
- $msg = "Problem in Inserting Data";
- }
- }
- ?>
- <h1 style="color:green"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement