<?php
header('content-type:application/x-javascript; charset=utf-8');
$con = mysqli_connect('localhost', 'cloudwps_cv', 'cooper@2019');
if (!$con) {

    die('Could not connect: ' . mysqli_error());

}
((bool)mysqli_query($con, "USE " . "cloudwps_coopervision"));  

$product = $_GET['p'];

mysql_query($con, "SET NAMES 'utf8'");


$query = "SELECT DISTINCT(area) FROM hktrialcenter WHERE ".$product."=1";

$result = mysql_query($con, $query);
$rows = array();

while($r = mysql_fetch_assoc($result)) {
    $rows[] = $r;
}
echo $_GET['callback'].'('.json_encode($rows).')';
