-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnection.php
More file actions
26 lines (23 loc) · 779 Bytes
/
Copy pathconnection.php
File metadata and controls
26 lines (23 loc) · 779 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
26
<?php
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$email = $_POST['email'];
$number = $_POST['phn'];
$add = $_POST['ad'];
$pri = $_POST['pri'];
$pin = $_POST['pin'];
// Database connection
$conn = new mysqli('localhost','root','Riya730@','dbname');
if($conn->connect_error){
echo "$conn->connect_error";
die("Connection Failed : ". $conn->connect_error);
} else {
$stmt = $conn->prepare("insert into registration(firstName, lastName, email, number,add,pri,pin) values(?, ?, ?, ?, ?, ?,?)");
$stmt->bind_param("sssisii", $firstName, $lastName, $email, $number,$add,$pri,$pin);
$execval = $stmt->execute();
echo $execval;
echo "Registration successfully...";
$stmt->close();
$conn->close();
}
?>