If you have a page to process the Login POST data, then build your sql query to fetch the column containing the user's time of registration.
Take $time_of_reg
as user's time of registration.
What ever timestamp you're using, convert it to a UNIX
timestamp using strtotime()
function.
Now adding 30 Days to the user's time of registration $time_of_reg_plus_30 = strtotime('+30 Days',$time_of_reg)
Now use an if condition to perform an update query if the current time is greater than or equal to 30 Days + users time of registration. This way you can perform an update query to your status
column, only if the user has been registered for 30 or more days.
if(time()>=$time_of_reg_plus_30)
{ //perform sql update query}
(having these values in a UNIX timestamp, makes it easier to compare)
<?//perform sql query to fetch user's time of registration, '$time_of_reg' in this case.
$time_of_reg = strtotime($time_of_reg); //Convert to UNIX timestamp
$time_of_reg_plus_30 = strtotime('+30 Days',$time_of_reg); // Add 30 Days To Registration Time
if(time()>=$time_of_reg_plus_30)
{ //perform sql update query if user has been registered for 30 Days or More
}
Remember to place this in the page that handles your Login POST data, this is a good way to achieve your objective without a cron job, as the user's status is updated whenever the user attempts to Log In.