recurring system my sql query [closed]

Make another table called payments which has
id of payment
userid of user
date they last paid
length of payment

Then, to check when a user’s set to expire,

SELECT date+length as expy FROM payments WHERE userid = $userid ORDER BY date DESC LIMIT 1

Store dates & lengths as unix time (number of seconds). If time > expy then their subscription is expired.

Leave a Comment