-
Notifications
You must be signed in to change notification settings - Fork 0
/
gym_search.php
51 lines (34 loc) · 1.06 KB
/
gym_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>Gym_Id</th>";
echo "<th>Name</th>";
echo "<th>Address</th>";
echo "<th>Type</th>";
echo "<th>Update</th>";
echo "<th>Delete</th>";
echo "</tr>";
echo "</div>";
$name=$_POST['name'];
$que=mysqli_query($conn,"SELECT * FROM `gym` WHERE CONCAT(`gym_id`,`gym_name`,`address`,`address`,`type`) LIKE '%".$name."%'");
if(mysqli_num_rows($que) > 0){
while($row=mysqli_fetch_array($que))
{
echo "<tr>";
echo "<td>".$row['gym_id']."</td>";
echo "<td>".$row['gym_name']."</td>";
echo "<td>".$row['address']."</td>";
echo "<td>".$row['type']."</td>";
echo "<td><a href='home.php?id=$row[gym_id]&info=update_gym'><i class='fas fa-pencil-alt'></i></a></td>";
echo "<td><a href='home.php?id=$row[gym_id]&info=delete_gym'><i class='fas fa-trash-alt'></i></a></td>";
echo "</tr>";
}
}else{
echo "<div class='alert alert-warning'><b>0 result</b></div>";
}
}
?>