-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
44 lines (29 loc) · 874 Bytes
/
create.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
include 'dbconfig.php';
$Cname = $_POST['Cname'];
$Cpackage = $_POST['Cpackage'];
$Cclasstype = $_POST['Cclasstype'];
$Ctopics = $_POST['Ctopics'];
$Cexercise = $_POST['Cexercise'];
$Cattandance = $_POST['Cattandance'];
$old_date = $_POST['Cdate'];
// echo ();
$Cdate = date('d-m-y', strtotime($old_date));
echo($Cname);
echo($Cpackage);
echo($Cclasstype);
echo($Ctopics);
echo($Cexercise);
echo($Cattandance);
echo($Cdate);
// // Insert Table
$sql = "INSERT INTO user (Cdate, Cname, Cpackage, Cclasstype, Ctopics, Cexercise, Cattandance)
VALUES ('$Cdate', '$Cname', '$Cpackage', '$Cclasstype', '$Ctopics', '$Cexercise', '$Cattandance')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
echo "<br>";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>