-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsanjeet1.php
35 lines (23 loc) · 881 Bytes
/
sanjeet1.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
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$roll_no = $_POST["roll_no"];
$date = $_POST["date"];
$status = $_POST["status"];
$servername = "127.0.0.1:3307";
$username = "root";
$password = "root";
$dbname = "attendancetraking";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO attendance_table (Roll_no, date, status, Professor_id) VALUES ('$roll_no', '$date', '$status','201')";
if ($conn->query($sql) === TRUE) {
echo "Data inserted successfully";
echo '<meta http-equiv="refresh" content="2;url=index.html">';
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}
?>