<?php
//Get our database abstraction file
session_start();
ini_set('display_errors', 1);
require('mysql.php');

if (isset($_GET['searchs']) && $_GET['searchs'] != '') {
	//Add slashes to any quotes to avoid SQL problems.
	$search = $_GET['searchs'];
	$s =("SELECT distinct(p_name)as p_name,product_id FROM products WHERE p_name like('" .$search . "%') ORDER BY p_name limit 10");
	$sql=mysqli_query($dbc,$s);
	while($suggest = mysqli_fetch_array($sql)) {
	
		echo '<a href=best_cat.php?id='.($_SESSION['product_id']=$suggest['product_id']).' >' . strtoupper($suggest['p_name']) . "</a>\n";
	}
}
?>