-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinsert.php
More file actions
25 lines (21 loc) · 860 Bytes
/
insert.php
File metadata and controls
25 lines (21 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
// Insert the content of connection.php file
include('connection.php');
// Insert data into the database
if(ISSET($_POST['insertData']))
{
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$address = $_POST['address'];
$skills = $_POST['skills'];
$designation = $_POST['designation'];
$sql = "INSERT INTO tbl_record(firstname, lastname, address, skills, designation, created_date) VALUES('$firstname', '$lastname', '$address', '$skills', '$designation', NOW())";
$result = mysqli_query($conn, $sql);
if($result){
echo '<script> alert("Data saved."); </script>';
header('Location: index.php');
}else{
echo '<script> alert("Data Not saved."); </script>';
}
}
?>