Forum Moderators: open

Message Too Old, No Replies

help creating an expiry column in mysql

         

moroose

6:25 am on Apr 9, 2008 (gmt 0)

10+ Year Member



i need help creating an enddate column for expiry
my startdate is a datetime and want the enddate to be a datetime,too.
the startdate is automatic(created by mysql on the fly with every submission,so i dont have a maual input to build on)

in php


$startdate=date("Y-m-d H:i:s");

in mysql
`startdate` datetime NOT NULL default '0000-00-00 00:00:00',
`enddate` datetime NOT NULL default '0000-00-00 00:00:00',

thank you for your help

wheelie34

8:18 am on Apr 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



create the end date on the fly the same time you create the startdate, that way they both get added without your input

$enddate = $startdate + however long you want it to last