Page 1 of 1

Insert Expiry Date into mysql

Posted: Tue Dec 29, 2009 5:20 am
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

Re: Insert Expiry Date into mysql

Posted: Tue Dec 29, 2009 10:15 pm
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.

Re: Insert Expiry Date into mysql

Posted: Tue Dec 29, 2009 11:50 pm
by jimcarry05
Thanks..... :-)