-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneral.php
More file actions
77 lines (64 loc) · 1.88 KB
/
Copy pathgeneral.php
File metadata and controls
77 lines (64 loc) · 1.88 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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
if(isset($_GET["selected_options"])) {
$selected_options = $_GET['selected_options'];
}
$host = "localhost";
$username = "root";
$password = "";
$dbname = "patient";
$con =mysqli_connect($host, $username, $password, $dbname, 3307);
if (!$con)
{
die("Connection failed!" . mysqli_connect_error());
}
$t = "";
if($selected_options == 'General Practitioner'){
$t = 'option1';
}
if($selected_options == 'Neurology'){
$t = 'option2';
}
if($selected_options == 'Urology'){
$t = 'option3';
}
if($selected_options == 'Cardiology'){
$t = 'option4';
}
if($selected_options == 'Paediatrics'){
$t = 'option5';
}
if($selected_options == 'Obs&Gyn'){
$t = 'option6';
}
if($selected_options == 'Geriatrics'){
$t = 'option7';
}
// echo $selected_options . "<br>" . $t;
// $h = "";
// if($experience == '0-5'){
// $h = '1';
// }
// if($experience == '5-10'){
// $h = '2';
// }
// if($experience == '10 or more'){
// $h = '3';
// }
$sql = "SELECT first_name, last_name, gender, selected_options, gender, phone, email FROM practitioner_table WHERE selected_options = '$t'";
// WHERE selected_options = '$selected_options'"
$rs = mysqli_query($con, $sql);
if(! $rs ) {
die('Could not get data: ' . mysql_error($con));
}
while($row = mysqli_fetch_assoc($rs)) {
echo "NAME :{$row['first_name']} ".
"{$row['last_name']} <br> ".
"SPECIALIZATION: {$selected_options} <br>".
"GENDER : {$row['gender']} <br> ".
"CONTACT : {$row['phone']} <br> ".
"EMAIL : {$row['email']} <br> ".
"--------------------------------<br>";
}
echo "Fetched data successfully\n";
mysqli_close($con);
?>