-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect.php
More file actions
25 lines (22 loc) · 809 Bytes
/
connect.php
File metadata and controls
25 lines (22 loc) · 809 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
$FirstName=$_POST["FirstName"];
$LastName=$_POST["LastName"];
$rollNumber=$_POST["rollNumber"];
$Department=$_POST["Department"];
$Category=$_POST["Category"];
$Description=$_POST["Description"];
// Database connection
$conn = new mysqli('localhost','root','','complaint');
if($conn->connect_error){
echo "$conn->connect_error";
die("Connection Failed : ". $conn->connect_error);
} else {
$stmt = $conn->prepare("insert into tb_comp(FirstName, LastName, rollNumber, Department, Category, Description) values(?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssisss", $FirstName, $LastName, $rollNumber, $Department, $Category, $Description);
$execval = $stmt->execute();
echo $execval;
echo "Complaint Filed successfully...";
$stmt->close();
$conn->close();
}
?>