<?php
include('../include/headscript.php');
include("../class/company.php");
$conn = new mysqli($servername, $username, $password, $database);
$id = $_POST['id'];
$sql = "SELECT * FROM analysisvocabulary WHERE preferred = 'N' AND refid = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param('i', $id);
$stmt->execute();
$result = $stmt->get_result();

$synonyms = [];
while ($row = $result->fetch_assoc()) {
    $synonyms[] = [
        'idanalysisvocabulary' => $row['idanalysisvocabulary'],
        'nameanalysisvoc' => $row['nameanalysisvoc']
    ];
}

echo json_encode($synonyms);
