<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/initconfig.php'; include_once 'dal/students.php'; $objStudent = new Students(); $student_data = $objStudent->get_names(); $student_name_col = array(); while ($fetch_data = mysqli_fetch_array($student_data)) { $student_name_col[] = array('key' => $fetch_data['student_id'], 'value' => $fetch_data['name']); } $student_col_json = json_encode($student_name_col); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon" href="../../favicon.ico"> <title>Jquery Auto Completion</title> <!-- Bootstrap core CSS --> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">