<?php

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

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

$dal = new DAL();
$sql = "SELECT PF.id, SF.spatialunit_id as fkid " .
       "SF.location,  SF.location AS location_text " .
       "FROM parcelfop PF, spatialunitfop SF " .
       "WHERE PF.id = $pf_id AND SF.parcelfop_id = PF.id LIMIT 1";
$result = $dal->query($sql);

echo json_encode($result);

?>

