Page 1 of 1

how to update...

Posted: Wed Dec 01, 2004 11:36 am
by kanchan
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....

Posted: Wed Dec 01, 2004 11:52 am
by xisle
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.

Posted: Wed Dec 01, 2004 12:09 pm
by kanchan
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.
ya the new data comes from form filled by users.........


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?

Posted: Wed Dec 01, 2004 12:37 pm
by xisle
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:

Code: Select all

$query = "SELECT user_id, registration_date FROM users 
WHERE registration_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) && user_id='".$_COOKIE&#1111;'userid']."'";
$result = mysql_query($query) or die(mysql_error());
$rows = mysql_num_rows($result);
	 
if($rows > 0)&#123;
    // ok
&#125;
else &#123;
    // show registration form
&#125;