100) { header('Content-Type: application/json; charset=utf-8'); echo '[]'; exit; } $statement = $pdo->prepare('SELECT id, name FROM authors WHERE name LIKE :query ORDER BY name LIMIT 10'); $statement->execute([':query' => '%' . $query . '%']); header('Content-Type: application/json; charset=utf-8'); echo json_encode($statement->fetchAll(PDO::FETCH_ASSOC), JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);