<?php

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

foreach ($_POST as $paramName => $paramValue) {
  if ($paramName == "selectid")
    $sp_id = $paramValue;
}
  
$dal = new DAL();

$sql = "SELECT PH.id, PH.filename, PH.cardinal_id, PH.phototag_id, " .
       "PH.time_taken, PH.note " .
       "FROM photospace PS, photo PH " .
       "WHERE PS.space_id = $sp_id " .
       "AND PH.id = PS.photo_id" ;
$result = $dal->query($sql);

echo json_encode($result);
?>

