Hello. I am seeking some help on job board script that I am working on. I am trying to use the below script to update the database if the current job is 30 days past the start date or post date. The code below is not working and if I change some things in the code, it will expire every post. Any help will be greatly appreciated. Thanks.
$resultx = mysql_query("SELECT * FROM jobs WHERE active='yes'")
or die(mysql_error());
while ($datax = mysql_fetch_array($resultx,MYSQL_NUM))
{
$id = $datax['id'];
$job_id = $datax['job_id'];
$sdate = $datax['sdate'];
$days = $data['days'];
$exp_date = $sdate + (60*60*24*30*3); //the number of seconds in 3 months
//$todays_date = date('Ymd', mktime (0, 0, 0, date ('m'), date ('d'), date ('Y')));
$now = time();
if($exp_date > $now) {
$update = "UPDATE jobs SET active='no' WHERE job_id = ".$job_id;
$results = mysql_query($update);
}
}