<?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 Distinct Category FROM raw WHERE Category LIKE :query ");
$stmt->execute(['query' => "%$q%"]);
$results = $stmt->fetchAll(PDO::FETCH_COLUMN);

echo json_encode($results);
