-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateindex.php
More file actions
30 lines (28 loc) · 1.03 KB
/
updateindex.php
File metadata and controls
30 lines (28 loc) · 1.03 KB
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
<?php
include_once("connect_to_mysql.php");
if(isset($_REQUEST['q']) && ($_REQUEST['q'])!='')
{
$r=$_REQUEST['q'][0];
if($r=='@')
{
$a=substr($_REQUEST['q'],1);
$sql=mysqli_query($conn,"SELECT CurrentPrice,EndTime,products.ProductID from products,auction where products.ProductID=auction.ProductID and auction.status='NOT OVER' and Pname like '%".$a."%' ORDER BY products.ProductID");
}
else
{
//echo $r;
$sql=mysqli_query($conn,"SELECT CurrentPrice,EndTime,products.ProductID from products,auction where products.ProductID=auction.ProductID and auction.status='NOT OVER' and CategoryID=".$_REQUEST['q']." ORDER BY products.ProductID");
} }
else
$sql=mysqli_query($conn,"SELECT CurrentPrice,EndTime,ProductID from auction where status='NOT OVER' ORDER BY ProductID");
$a=array();
$b="";
while($row=mysqli_fetch_array($sql,MYSQLI_ASSOC))
{
//echo $b;
$b=$b.$row["CurrentPrice"]." ".$row["ProductID"]." ".$row["EndTime"]." ";
// array_push($a,$row["CurrentPrice"]);
//echo $row["CurrentPrice"];echo'<br>';
}
echo $b;
?>