-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
41 lines (37 loc) · 770 Bytes
/
search.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
<?php
include"database.php";
$sql="SELECT * FROM staff WHERE TNAME LIKE '{$_POST["s"]}%' ";
$res=$db->query($sql);
echo "<table border='1px' class='table'>
<tr>
<th>T.No</th>
<th>Name</th>
<th>Qualification</th>
<th>Salary</th>
<th>View</th>
<th>Delete</th>
</tr>
";
if($res->num_rows>0)
{
$i=0;
while($row=$res->fetch_assoc())
{
$i++;
echo "<tr>
<td>{$i}</td>
<td>{$row["TNAME"]}</td>
<td>{$row["QUAL"]}</td>
<td>{$row["SAL"]}</td>
<td><a href='staff_view.php?id={$row["TID"]}' class='btnb'>View</a></td>
<td><a href='staff_delete.php?id={$row["TID"]}' class='btnr'>Delete</a></td>
</tr>
";
}
echo "</table>";
}
else
{
echo "<p>No Record Found</p>";
}
?>