I am currently trying to count through some records within a table, and return a figure based on any records placed within the last month.
At the moment I am really struggling with the SQL, can anyone help me out?
$date = 30;
$numdays = date('Y-m-d', mktime(0,0,0,date('d'), date('m')-$date, date('Y')));
$sql = "SELECT COUNT(DISTINCT jobid) AS jobid, UNIX_TIMESTAMP(date) AS udate FROM job WHERE date <= '$numdays'";