<?php
require "config.php";

$q = $_GET['q'] ?? '';

$data = [];

$query = $conn->query("
SELECT *
FROM master_sk
WHERE nomor_sk LIKE '%$q%'
ORDER BY nomor_sk ASC
LIMIT 10
");

while($d = $query->fetch_assoc()){
    $data[] = $d;
}

echo json_encode($data);