-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect1.php
More file actions
28 lines (27 loc) · 1.03 KB
/
connect1.php
File metadata and controls
28 lines (27 loc) · 1.03 KB
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
<?php
$studentId = $_POST['studentId'];
$studentName = $_POST['studentName'];
$classRoll = $_POST['classRoll'];
$department = $_POST['department'];
$batch = $_POST['batch'];
$session = $_POST['session'];
$gender = $_POST['gender'];
$hall = $_POST['hall'];
$email = $_POST['email'];
$password = $_POST['password'];
$phoneNumber = $_POST['phoneNumber'];
// Database connection
$conn = new mysqli('localhost','root','','StudentInfo');
if($conn->connect_error){
echo "$conn->connect_error";
die("Connection Failed : ". $conn->connect_error);
} else {
$stmt = $conn->prepare("insert into registration(studentId, studentName, classRoll, department, batch, session, gender, hall, email, password, phoneNumber) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssissssssss", $studentId, $studentName, $classRoll, $department, $batch, $session, $gender, $hall, $email, $password, $phoneNumber);
$execval = $stmt->execute();
echo $execval;
echo "Registration successfully...";
$stmt->close();
$conn->close();
}
?>