getOpeningDates.php 414 Bytes
Newer Older
BuildTools's avatar
BuildTools committed
1
2
3
4
5
<?PHP
	$user = 'apache';
	$pass = 'e164AzpQx564TpJa';
	$db = new PDO('mysql:host=localhost;dbname=reservation', $user, $pass);
	
BuildTools's avatar
BuildTools committed
6
7
8
	$statement = $db -> prepare("SELECT date FROM opening WHERE date >= ? ORDER BY date ASC");
	$statement->execute(array(date("Y-m-d")));
	
BuildTools's avatar
BuildTools committed
9
	$data = array();
BuildTools's avatar
BuildTools committed
10
    foreach( $statement->fetchAll() as $row ){
BuildTools's avatar
BuildTools committed
11
12
13
		array_push($data, $row["date"]);
    }
	echo json_encode($data);
uoure's avatar
uoure committed
14
?>