-
Notifications
You must be signed in to change notification settings - Fork 0
/
searchjeepdata.php
55 lines (51 loc) · 1.44 KB
/
searchjeepdata.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
<?php
include 'dbh.inc.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Safari Jeep search data</title>
<style>
body {
background-color: #1f242d;
color: #a7a0a0;
}
table tr {
text-align: center;
}
</style>
</head>
<body>
<table border="1" width="100%">
<?php
if(isset($_POST['submit'])) {
$search = $_POST['search'];
$sql = "SELECT * FROM jeepreservation WHERE id LIKE '$search' or name LIKE '%$search%'";
$result = mysqli_query($conn, $sql);
if($result) {
if(mysqli_num_rows($result) > 0) {
echo '<thead>
<tr>
<th>Reservation ID</th>
<th>Full Name</th>
</tr></thead>';
while($row = mysqli_fetch_assoc($result)) {
echo '<tbody>
<tr>
<td><a href="searchdatajeep.php?data='.$row['id'].'">'.$row['id'].'</a></td>
<td>'.$row['name'].'</td>
</tr></tbody>';
}
}
else {
echo '<h2>Data not found</h2>';
}
}
}
?>
</table>
</body>
</html>