<?php
    session_start();
    include 'config.php';
    $uid = $_SESSION['userid'];
    $uname = $_SESSION['uname'];
    $regime_type = $_SESSION['regime_type'];
    $cargo_channel = $_SESSION['cargo_channel'];   
    $searchTerm = $_GET['term'];

    //get matched data from countries table
    $sql_stmt = "SELECT description FROM country_master where code LIKE '%$searchTerm%' or description LIKE '%$searchTerm%' ";
    $result = mysqli_query($con,$sql_stmt);
    while ($row = $result->fetch_assoc()) 
    {
        $data[] = $row['description'];
    }
    //return json data
    echo json_encode($data);
?>