-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect.php
More file actions
34 lines (30 loc) · 868 Bytes
/
connect.php
File metadata and controls
34 lines (30 loc) · 868 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
27
28
29
30
31
32
33
34
<?php
$name = $_POST['name'];
$phno = $_POST['phno'];
$addr = $_POST['addr'];
$gender = $_POST['gender'];
//database connection
$servername = "localhost";
$username = "username";
$password = "password";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
<!-- $conn = new mysqli('localhost','root','','petreg');
if($conn->connect_error)
{
die('Connection failed :' .$conn->connect_error);
}else{
$stmt=$conn->prepare("insert into registration(name,phno,addr,gender)values(?, ?, ?, ?)");
$stmt->bind_param("ssss",$name,$phno,$addr,$gender);
$stmt->execute();
echo "Welcome ! Registration Successful";
$stmt->close();
$conn->close();
}
?> -->