<?php

require_once($_SERVER['DOCUMENT_ROOT'] . '/sys/db.php');

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

  $dal = new DAL();
 
  $sql = "SELECT 0 as id, TABLE_NAME AS name, SPACE(0) as refno " .
         "FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'newdi652_aratest' " .
         "AND TABLE_NAME LIKE '%$tableName%' GROUP BY TABLE_NAME";
  $result = $dal->query($sql);
}
echo json_encode ($result);


