<?php
session_start();
error_reporting(1);
include('includes/config.php');

//$start = $_POST['start'];
//$end = $_POST['end']; 
$selectTable = SELECT_TABLE;

$old = "SELECT * FROM $selectTable  order by CreationDate desc limit 50;";
$query = $dbh->prepare($old);
$query->execute();


$results = $query->fetchAll(PDO::FETCH_OBJ);

//print_r("results: ", $results);

if($query->rowCount() > 0){
	echo json_encode($results);

} else {
	$msg = "No data Found";
	echo json_encode(array("warning" => $msg));
}


	
?>
