-
Notifications
You must be signed in to change notification settings - Fork 2
/
insertedPopUp.php
37 lines (29 loc) · 837 Bytes
/
insertedPopUp.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
36
37
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "scdatabase";
$name=$_POST["a_name"];
$code=$_POST["a_code"];
$mobile=$_POST["m_no"];
$email=$_POST["email"];
$address=$_POST["address"];
$charge=$_POST["charge"];
$acheivments=$_POST["acheivments"];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO advocates (name, code, mobile_no,email_id,address,charge,acheivments)
VALUES ('$name','$code','$mobile','$email','$address','$charge','$acheivments')";
if ($conn->query($sql) === TRUE) {
<script type="text/javascript">
alert('Details inserted !')
</script>
} else {
echo"0";
}
$conn->close();
?>