-
Notifications
You must be signed in to change notification settings - Fork 9
/
srch_cat.php
39 lines (35 loc) · 1.01 KB
/
srch_cat.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
<?php
require 'config.php';
$condition = "";
$conn = connection();
// echo $_POST['name']; die;
if(isset($_POST['sname']) && $_POST['sname']!=""){
$condition.=" and cat_name like '".$_POST['sname']."%'";
}
if(isset($_POST['sdes']) && $_POST['sdes']!=""){
$condition.=" and cat_des like '".$_POST['sdes']."%'";
}
$sql = "SELECT * FROM `category` WHERE 0=0 $condition";
$data = $conn->query($sql);
$conn=null;
?>
<table class="table table-condensed table-hover table-bordered table-striped">
<thead>
<tr>
<th><center>S. no.</center></th>
<th><center>Name</center></th>
<th><center>Description</center></th>
<!-- <th><center>Status</center></th> -->
</tr>
</thead>
<tbody style="color:black;">
<?php $s=0;
foreach ($data as $row){ $s++; ?>
<tr>
<td><center><?php echo $s; ?></center></td>
<td><?php echo ucwords($row['cat_name']); ?></td>
<td><?php echo ucwords($row['cat_des']); ?></td>
</tr>
<?php } ?>
</tbody>
</table>