<?php
$host = 'localhost';
$db = 'apmmwfdg_glakb';
$user = 'apmmwfdg_apmmauser';
$pass = 'asgharali2007';
$conn = new PDO("mysql:host=$host;dbname=$db", $user, $pass);

$q = isset($_GET['q']) ? $_GET['q'] : '';
$stmt = $conn->prepare("SELECT Size FROM raw WHERE Size LIKE :query and Category='Cotton' ");
$stmt->execute(['query' => "%$q%"]);
$results = $stmt->fetchAll(PDO::FETCH_COLUMN);

echo json_encode($results);
