include("head1.php");
include("pagenv.php");
$search = ($_GET['search'])?htmlspecialchars($_GET['search']):'';
$sortid = $_GET["sortid"];
$order = ($_GET['order'])?$_GET['order']:'';
?>
$sql = "SELECT title FROM product_cat WHERE sortid = $sortid ORDER BY title LIMIT 1";
if($qry = mysqli_query($DB->link_id,$sql)){
if($row=mysqli_fetch_row($qry)){
?>
}
}
?>

$sql = "SELECT * FROM product WHERE title like '%$search%'";
if($sortid)$sql .= " AND sortid = '$sortid'";
if($order=='title') {
$sql .= " ORDER BY $order ASC";
}elseif($order=='pagerank'){
$sql .= " ORDER BY $order DESC";
}else {
$sql .= " ORDER BY title ASC";
}
if($qry = mysqli_query($DB->link_id,$sql)){
if($count=mysqli_num_rows($qry)){
while($arr = mysqli_fetch_array($qry)){
?>
if($arr['content']){?>
}?>
}
}else{echo "- No Products Exist
";}
}
?>