-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoctor_select.php
More file actions
36 lines (26 loc) · 1.06 KB
/
doctor_select.php
File metadata and controls
36 lines (26 loc) · 1.06 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
<?php
include "config.php";
if (!empty($_GET["eid"])){
$eid = $_GET["eid"];
$sql_comment = "SELECT * FROM doctor INNER JOIN employee ON doctor.e_id = employee.e_id WHERE doctor.e_id = '".$eid."' ";
if (!empty($_GET["pro"])) {
$pro = $_GET["pro"];
$sql_comment .= " AND doctor.profession = '".$pro."' ";
}
$myresult = mysqli_query($db,$sql_comment);
while($rows = mysqli_fetch_assoc($myresult)){
echo $rows["e_id"] . " - " . $rows["name"] . " - " . $rows["age"] . " - " . $rows["salary"] . " - " . $rows["profession"] . "<br>";
}
}
else {
$sql_comment = "SELECT * FROM doctor INNER JOIN employee ON doctor.e_id = employee.e_id ";
if (!empty($_GET["pro"])) {
$pro = $_GET["pro"];
$sql_comment .= " WHERE doctor.profession = '".$pro."' ";
}
$myresult = mysqli_query($db,$sql_comment);
while($rows = mysqli_fetch_assoc($myresult)){
echo $rows["e_id"] . " - " . $rows["name"] . " - " . $rows["age"] . " - " . $rows["salary"] . " - " . $rows["profession"] . "<br>";
}
}
?>