Page 1 of 1

Expire after 365 days? [SOLVED]

Posted: Wed Jun 18, 2008 5:05 am
by jmansa
I was just wandering if it is possible to automaticly add 365 days to my insert.

Code: Select all

mysql_query("INSERT INTO users (uid, name, created) VALUES ('$uid', '$name', NOW())");
Now I want to add a field called "expire" to my table and automaticly when a user is created it sets an expire date 365 days ahead... Can this be done???

Re: Expire after 365 days?

Posted: Wed Jun 18, 2008 5:30 am
by jmansa
Got it...

Code: Select all

mysql_query("INSERT INTO users (uid, name, created, expired) VALUES ('$uid', '$name', NOW(), DATE_ADD(NOW(), INTERVAL 1 YEAR))");
Solved...