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

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

echo json_encode($results);
