can anybody tell me...........
suppose i have fields like name,add,email,regdate,block in my table..
and i have data like... kanchan,nepal,kanchan@hotmail.com,Dec 1,2004,no
and now my question is.....
i want this data to be updated after 30 days from the registered date , automatically...........
HOW???????
plzzzzzzzz, help me....
how to update...
Moderator: General Moderators
ya the new data comes from form filled by users.........xisle wrote:where does the new data come from?
if user fills out a form..
check date of registration and force them to update the info after the 30 days.
no no i don't wanna force user but..... when the page (index.php) is viewed, then the data which are 30 days old are automatically to (block=yes)..
don't u know this type.........
and how to count days in php?
I can give you some suggestions, but not do it for you.
Store the registration data in DB and set a cookie with user_id
Here is a sample DB query to check date:
Store the registration data in DB and set a cookie with user_id
Here is a sample DB query to check date:
Code: Select all
$query = "SELECT user_id, registration_date FROM users
WHERE registration_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) && user_id='".$_COOKIEї'userid']."'";
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($result);
if($rows > 0){
// ok
}
else {
// show registration form
}