Insert Expiry Date into mysql

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
jimcarry05
Forum Newbie
Posts: 2
Joined: Tue Dec 29, 2009 5:16 am

Insert Expiry Date into mysql

Post by jimcarry05 »

Hello, I am working on a project. And I want to insert the expiry date of the products. So how can I insert the expiry date into mysql using PHP script.
Thanks
iamngk
Forum Commoner
Posts: 50
Joined: Mon Jun 29, 2009 2:20 am

Re: Insert Expiry Date into mysql

Post by iamngk »

you can write the following thing in insert query's values.

DATE_ADD(curdate( ) , INTERVAL ".$exp_years." YEAR )

$exp_years - is number of years.
jimcarry05
Forum Newbie
Posts: 2
Joined: Tue Dec 29, 2009 5:16 am

Re: Insert Expiry Date into mysql

Post by jimcarry05 »

Thanks..... :-)
Post Reply