<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "pattern")
    $pattern = $paramValue;
}

$dal = new DAL();
$sql = "SELECT id, CONCAT (refno, ': ',  name) AS text FROM project " .
       "WHERE name LIKE '%$pattern%' OR refno LIKE '%$pattern%'" ;
$result = $dal->query($sql);

echo json_encode ($result);


