Jump to content

user payment/registration expires field required?


joanna2008

Recommended Posts

Hello..

 

I am still designing my database and am not sure how to proceed. I would like my users to register and pay. Should I create a field in the database that will store a value once the user has paid? And a date field so I can track when their membership expires? Can anyone recommend any tutorials for this purpose? :-\

 

Thank you.

well what would be an easy way to go about it would be to make a tinyint field called paid with a default of 0 (0 = not paid) and when the user pays set this to 1.

 

and when they login just do SELECT * FROM users WHERE paid='1'

 

and for the expiration, make a field called expire and put a timestamp in there for 12 months ahead or however long they pay for.

 

and again on login

 

if (time() >= "$expiretime") {

echo "your account has expired... redirecting to payment";

} else {

continue the login

}

Thank you!

If I put a timestamp - I would say add 3 months(ie) to todays date and then save that date into my database, correct?

So when I pull up the user account - I will creat a statement to check if that timestamp field is expired.

Is there a script for checking a timestamp field? Sorry, I always store dates in 3 different fields (day month and year). I am just getting a little confused thinking about this one. Thank you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.