HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /var/www/nclive/backend/spsearchsu.php
<?php
header("Access-Control-Allow-Origin: *");
header('Content-Type: application/json');
/* ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL); */
include 'config.php';

if (isset($_REQUEST['query'])) {
    $query = $_REQUEST['query'];


   $query = $db->query("SELECT t1.exam_id, t1.exam_name, t2.name FROM sp_exam as t1
LEFT JOIN sp_exam_category as t2 on t2.cat_id=t1.cat_id 
    WHERE t1.exam_name LIKE '%$query%' ");
	$array = array();

    while ($row = $query->fetch()) {

        $array[] = array (
            'label' => $row['exam_name'],
            'id' => $row['exam_id'],
            'value' => $row['exam_name'] . ' in ' . $row['name'],
        );
    }
    echo json_encode ($array);
}

?>