<?php
   session_start();

  
  include("../../db.php"); /* ESTABLISH CONNECTION IN THIS FILE; MAKE SURE THAT IT IS mysqli_* */
  
 
 $term=$_GET['term'];
 $column=$_GET['column'];
 $table=$_GET['table'];
  $issue_date=$_GET['issue_date'];

  $stmt = $conn->prepare("SELECT `$column` FROM `$table` where `$column` like '%$term%' and issue_date ='$issue_date' ORDER BY  id desc
 "); /* START PREPARED STATEMENT */
  $stmt->execute(); /* EXECUTE THE QUERY */
  $stmt->bind_result($description); /* BIND THE RESULT TO THIS VARIABLE */
  while($stmt->fetch()){ /* FETCH ALL RESULTS */
    $description_arr[] = $description; /* STORE EACH RESULT TO THIS VARIABLE IN ARRAY */
  } /* END OF WHILE LOOP */

  echo json_encode($description_arr); /* ECHO ALL THE RESULTS */
  

 
?>