<?php
require('config.php');
$linkID = new PDO('mysql:host='.Config::DB_HOST.';dbname='.Config::DB_NAME, Config::DB_USERNAME, Config::DB_PASSWORD);
$linkID->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Setting ERRMODE
date_default_timezone_set('America/Toronto');

$today = date("Y-m-d"); 
$waitlistexpires = $linkID->query("SELECT * FROM waitlist WHERE waitlist.date_expires=".'"'.$today.'"')->fetchAll(PDO::FETCH_ASSOC);
//echo $waitlistexpires;
foreach($waitlistexpires as $we){
    $sql = "DELETE FROM waitlist WHERE id =".$we['id'];
  $stmt = $linkID->prepare($sql);
  $stmt->execute();
}





?>