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.

Link to comment
Share on other sites

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

}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.