joanna2008 Posted February 13, 2008 Share Posted February 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/90806-user-paymentregistration-expires-field-required/ Share on other sites More sharing options...
Kingy Posted February 13, 2008 Share Posted February 13, 2008 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 } Quote Link to comment https://forums.phpfreaks.com/topic/90806-user-paymentregistration-expires-field-required/#findComment-465442 Share on other sites More sharing options...
joanna2008 Posted February 13, 2008 Author Share Posted February 13, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/90806-user-paymentregistration-expires-field-required/#findComment-465448 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.