Skip to content

Instantly share code, notes, and snippets.

@facumartig
Last active December 20, 2015 00:39
Show Gist options
  • Save facumartig/6043498 to your computer and use it in GitHub Desktop.
Save facumartig/6043498 to your computer and use it in GitHub Desktop.
<?php
require_once 'config/db_config.php';
$sql = "SELECT * FROM events WHERE timestamp = '".$_POST['d']."' ORDER BY ID";
$query = mysqli_query($link, $sql);
if (mysqli_num_rows($query) > 0){
$data = array(); $index = 0;
while ($recset = mysqli_fetch_array($query)){
$data[$index] = $recset;
$index++;
}
echo json_encode($data);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment