-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
42 lines (39 loc) · 1.8 KB
/
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
<?php include("header.php"); ?>
<?php include("connection.php"); ?>
<div style="height:fit-content;">
<div>
<div class="sizefull flex flex-center flex-col ">
<?php
if(isset($_GET['s'])){
$s="%".$_GET['s']."%";
$sql="SELECT * FROM product Where name LIKE '$s' or category LIKE '$s' or description LIKE '$s' or material LIKE '$s' ORDER BY name";
$result=mysqli_query($conn,$sql);
while($rows=mysqli_fetch_array($result)){?>
<!--start here -->
<div class="card product-card flex flex-spacearound">
<img src="<?php echo $rows['img'];?>" class="product-img">
<div class="sizefull product flex flex-col ">
<div class="product-title text-left">
<?php echo $rows['name']?>
</div>
<div class="text-left">
Category: <?php echo $rows['category']?>
</div>
<div class="product-material text-left">
Material: <?php echo $rows['material']?>
</div>
<div class="product-desc text-left textgrey">
<?php echo $rows['description']?>
</div>
<div class="text-right">
<a href=<?php echo "./product.php?pid=".$rows["pid"]?>> View More...</a>
</div>
</div>
</div>
<!--end here -->
<?php
}}?>
</div>
</div>
</div>
<?php include("footer.php"); ?>