








<!DOCTYPE html>
<html>
<head>

</head>
<body >

	
<?php


session_start();



$q = $_GET['q'];

		
require 'config.php';

$con = mysqli_connect(DB_SERVER, DB_USER, DB_PASS);
$database = $_SESSION['database'];
	
	
//$con = mysqli_connect('localhost','peter','abc123','my_db');
if (!$con) {
  die('Could not connect: ' . mysqli_error($con));
}

mysqli_select_db($con,$database);
//$sql="SELECT * FROM txn_table WHERE product_name = '".$q."'";
	$sql="SELECT * FROM product_table WHERE cat = '$q'";
$result = mysqli_query($con,$sql);


$row = mysqli_fetch_array($result) ;

 // echo  $row['1'] ;
	

	
	 echo $row['product_name'].'<br>';
  echo "Unit Price:  ". $row['unit_p'].'<br>';
	 echo "  Avail Qty:  ". $row['unit_q'] ;
	
	
 
?>

	


	<input type="hidden"  value = "<?php echo  $row['unit_p'] ?>" name="unit_p" id="unit_p">
<input type="hidden"  value = "<?php echo  $row['unit_q'] ?>" name="unit_q" id="unit_q">
	
	

	
	
</body>
</html>
