-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearchdata.php
63 lines (56 loc) · 2.07 KB
/
searchdata.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
<html>
<head>
<title>Organ Donation</title>
<style>
table, th, td {
border: 1px solid black;
padding: 5px;
}
table {
border-spacing: 15px;
}
</style>
</head>
<body>
<div class="container">
<form action="" method="post">
<input type="text" name="id" placeholder="Id"/>
<input type="submit" name="search" value="search by id"/>
</form>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
<th>Password</th>
<th>Father Name</th>
<th>Address</th>
<th>Phone Number</th>
</tr><br>
<?php
$connection = mysqli_connect("localhost","root","");
$db = mysqli_select_db($connection,'three38inc');
if(isset($_POST['search']))
{
$id = $_POST['id'];
$query = "SELECT *from employee where id='$id'";
$query_run = mysqli_query($connection,$query);
while($row=mysqli_fetch_array($query_run)){
?>
<tr>
<td> <?php echo $row['fname'];?></td>
<td> <?php echo $row['lname'];?></td>
<td> <?php echo $row['email'];?></td>
<td> <?php echo $row['password'];?></td>
<td> <?php echo $row['fathername'];?></td>
<td> <?php echo $row['address'];?></td>
<td> <?php echo $row['phone'];?></td>
</tr>
<?php
}
}
?>
</table>
</div>
</body>
</html>