I am trying to set a cron job script that checks for and deletes records with timestamps older than 15 minutes, however, the below script is not working and I have not a clue as to why. I am unfamiliar with date comparisons, tried to look online for solutions to my goals, but none of them are working. Scripting that accomplishes would be fantastic! Thank you in advance!
<?php
include('../../db/db.php');
mysql_select_db($database_conn_abrv, $con);
$timetocheck = date('Y-m-d H:i:s', mktime(date("H"), date("i") - 15, date("s"), date("m"), date("d"), date("Y"));
mysql_query("DELETE FROM loginbans WHERE time_created>$timetocheck",$con) or die(mysql_error());
?>