-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.php
39 lines (30 loc) · 859 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
<?php
include "includes/common.php";
top("Search");
sidebar();
contenttop();
if(isset($_REQUEST['searcht'])){
$s=safe($_REQUEST['searcht']);
$conn=connect();
$q="Select * from products where keywords like '%".$s."%'";
$result= mysqli_query($conn,$q) or die("query failed");
while($row=mysqli_fetch_array($result)){
$name=$row['brand']." ".$row['model'];
createproduct($name,$row['image'],$row['mrp'],$row['ofp'],$row['pid']);
}
mysqli_close($conn);
}
if(isset($_REQUEST['bid'])){
$conn=connect();
$q="Select * from products where brand='".$_REQUEST['bid']."'";
$result= mysqli_query($conn,$q) or die("query failed");
while($row=mysqli_fetch_array($result)){
$name=$row['brand']." ".$row['model'];
createproduct($name,$row['image'],$row['mrp'],$row['ofp'],$row['pid']);
}
mysqli_close($conn);
}
?>
<?php
contentbottom();
?>