Check expired vip users

Asked

Viewed 30 times

0

Good afternoon, everyone,

I have a classified portal and I’m putting VIP accounts on it, these accounts will have the possibility to make an amount of vip posts by the plan contracted. I already know how to prevent her from continuing to enjoy VIP benefits after the due date but I couldn’t find a simple way to reset the ads that were VIP so far. I save the user vip expiration date this way in the 2016-12-02 string database table. OBS* I save the due date in the user table and table announcements I mark if the ad is vip or not.

Someone could tell me how to make a cronjob that works with this date and remove the VIP field from posts ?

Thank you

  • 4

    So that all this complication? $usuario_e_vip = $vencimentovip >= date() - do not need to change anything on the date just check whether or not it is at the time you want - As for saving date in string, there is no point to this. If you use DB, date is in date format, or at most in an integer. Simplify, it is easier to maintain, and works better. Avoid mixing storage format with display format, rarely does anyone need it in a real case (and most who think they need it are often wrong)

  • The same logic works in DB if you are displaying the advertisements, SELECT campos FROM tabela WHERE vencimentovip >= CURRENT_DATE

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.