Expire after 365 days? [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Expire after 365 days? [SOLVED]

Post 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???
Last edited by jmansa on Wed Jun 18, 2008 5:30 am, edited 1 time in total.
jmansa
Forum Commoner
Posts: 81
Joined: Wed Aug 23, 2006 4:00 am

Re: Expire after 365 days?

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