how to update...

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
kanchan
Forum Commoner
Posts: 80
Joined: Tue Nov 30, 2004 12:03 pm

how to update...

Post 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....
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post 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.
kanchan
Forum Commoner
Posts: 80
Joined: Tue Nov 30, 2004 12:03 pm

Post 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?
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post 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;
Post Reply