-
Notifications
You must be signed in to change notification settings - Fork 0
/
practitioner-sign-up.php
63 lines (50 loc) · 1.99 KB
/
practitioner-sign-up.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
// getting all values from the HTML form
if(isset($_POST['submit']))
{
$fname = $_POST['first_name'];
$lname = $_POST['last_name'];
$dob = $_POST['dob'];
$gender = $_POST['gender'];
$selected_languages = $_POST['selected_languages'];
$selected_options = $_POST['selected_options'];
$experience = $_POST['experience'];
$Certificate = $_POST['Certificate'];
$description = $_POST['description'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$pwd = $_POST['password'];
}
// database details
$host = "localhost";
$username = "root";
$password = "";
$dbname = "patient";
// creating a connection
$con = mysqli_connect($host, $username, $pwd, $dbname, 3307);
// to ensure that the connection is made
if (!$con)
{
die("Connection failed!" . mysqli_connect_error());
}
// using sql to create a data entry query
$sql = "INSERT INTO practitioner_table (first_name, last_name, dob, gender, selected_languages, selected_options, experience, Certificate, description, phone, email, password) VALUES ('$fname', '$lname', '$dob', '$gender', '$selected_languages', '$selected_options', '$experience', '$Certificate', '$description', '$phone', '$email', '$pwd')";
// send query to the database to add values and confirm if successful
$rs = mysqli_query($con, $sql);
if($rs)
{
echo "Practitioner signed up successfully";
}
// foreach($selected_languagues as $i){
// $selected_languages=$i;
// $sql = "INSERT INTO practitioner_table (selected_languages) VALUES ($selected_languages)";
// mysqli_query($con, $sql);
// }
// foreach($selected_options as $i){
// $selected_options=$i;
// $sql = "INSERT INTO practitioner_table (selected_options) VALUES ($selected_options)";
// mysqli_query($con, $sql);
// }
// close connection
mysqli_close($con);
?>