Forum Moderators: coopster
$sql = 'SELECT * FROM table_name WHERE user_id = "' . $user_id . '"ORDER BY payment_date DESC LIMIT 1';
$result = mysql_query($sql);
$res = mysql_fetch_assoc($result); Problem 1. I'm not sure what the proper code is to use to check for all dates 12 months before todays date?
Probably better ways to do that, but meh, I'm tired.$twelve_months_prev = mktime(date('H'), date('i'), date('s'), date('n'), date('j'), (date('Y') - 1));
if(strtotime($res['payment_date']) > $twelve_months_prev) {
// Update column
}