<?
require ($_SERVER['DOCUMENT_ROOT'].'/Core/core.php');
$rekl = $db->prepare("SELECT * FROM `reklama`");
$rekl->execute();
$rekl = $rekl->fetchAll();
foreach($rekl as $row){
if($row['time'] <= time()){
$sql = $db->prepare("DELETE FROM `reklama` WHERE `id` = ?");
$sql->execute([$row['id']]);
}
}