Ok, so I am trying to code something to where when people register, they can pay for a membership. They can pay for 30 days, 60 days or 90 days. (This is only an example.)
How would I be able to code it to where it will check to see if there account has expired? I have already coded the registration and log in. And there is a timestamp submitted to the MySQL db, as date(ymdHis).
But now, I am having a problem. The person asking me to code this has asked to let them sign up for a 1 day free trial.
Heres the thing, when someone signs up for it, if they sign up at 11:59 PM, they only get a 1 minute free trial, instead a full 24 hours. How should I fix this?
//Gets information about account $get_email_data = "SELECT * FROM online_videos WHERE email='$email'"; $get_email_result = mysql_query($get_email_data, $datacon); $email_row = mysql_fetch_assoc($get_email_result);
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' DAY)' at line 1
But according to the manual, DAY is where it should be...
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '23:58:56 DAY)' at line 1
Echo out the query and debug it. It looks like you are putting in the wrong variable for the interval. It should be an integer number....e.g. 1 day, 2 day you get the idea.