-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtrainer_search.php
51 lines (33 loc) · 1.11 KB
/
trainer_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
42
43
44
45
46
47
48
49
50
51
<?php
require('db.php');
$name="";
if (isset($_POST['name'])) {
echo "<div class='container'>";
echo "<table class='table table-bordered table-hover mt-3'>";
echo "<tr>";
echo "<th>Trainer_Id</th>";
echo "<th>Name</th>";
echo "<th>Time</th>";
echo "<th>Mobile No</th>";
echo "<th>Update</th>";
echo "<th>Delete</th>";
echo "</tr>";
echo "</div>";
$name=$_POST['name'];
$que=mysqli_query($conn,"SELECT * FROM `trainer` WHERE CONCAT(`trainer_id`,`name`,`time`,`mobileno`) LIKE '%".$name."%'");
if(mysqli_num_rows($que) > 0){
while($row=mysqli_fetch_array($que))
{
echo "<tr>";
echo "<td>".$row['trainer_id']."</td>";
echo "<td>".$row['name']."</td>";
echo "<td>".$row['time']."</td>";
echo "<td>".$row['mobileno']."</td>";
echo "<td><a href='home.php?id=$row[trainer_id]&info=update_trainer'><i class='fas fa-pencil-alt'></i></a></td>";
echo "<td><a href='home.php?id=$row[trainer_id]&info=delete_trainer'><i class='fas fa-trash-alt'></i></a></td>";
}
}else{
echo "<div class='alert alert-warning'><b>0 result</b></div>";
}
}
?>