Change column of a Table in DB based on another column of the same Table

0

I have a USERS table that has the following columns:

username > usuário
stripe_active > Valor 0 ou 1
created_at > Data da Assinatura
subscription_ends_at > Será data final da assinatura

I want to know if you have a routine to get the date on subscription_ends_at and based on it as soon as the user logs in if the date is the same as the BD or Top, change the column stripe_active and change to 0 (Inactive).

This routine would be placed on the page header.php and of course, all data cited above would be read according to each logged in user. The system itself will take the user to the subscription renewal page.

    
asked by anonymous 18.09.2015 / 16:08

0 answers