-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsearchname.php
57 lines (43 loc) · 1.41 KB
/
searchname.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="bstyle.css">
<table id="customers">
<tr>
<th>Handler</th>
<th>Entry Time</th>
<th>Out Time</th>
<th>purpose for visiting</th>
<th>visitor id</th>
<th>Date</th>
<th>Address</th>
<th>Apartment</th>
<th>Name</th>
<th>Email</th>
<th>Searcher</th>
<th>Phone</th>
</tr>
<?php
$conn = new mysqli('localhost', 'root', '', 'Visitor Management');
if ($conn->connect_error){
die("Connection failed: ". $conn-> connect_error);
}
$sql = "SELECT * FROM visitor WHERE searcher != '' ;";
$result_1 = $conn-> query($sql);
if ($result_1-> num_rows > 0){
while ($row = $result_1->fetch_assoc()){
echo "<tr><td>".$row["handler"]."</td><td>".$row["Entry_Time"]."</td><td>".$row["Out_Time"]."</td><td>".$row["purpose_for_visiting"]."</td><td>".$row["visitor_id"]."</td><td>".$row["Date"]."</td><td>".$row["address"]."</td><td>".$row["apartment"]."</td><td>".$row["name"]."</td><td>".$row["email"]."</td><td>".$row["searcher"]."</td><td>".$row["phone"]."</td></tr>\n";
}
echo "</table>";
}
else {
echo "0 result";
}
$conn-> close();
?>
</table>
</body>
</html>