I want to have a date (could be of date type or some other type) field in mysql database which would store an expiry date. This date is entered by the user and is sent to the PHP script as a querystring of the form mm/dd/yyyy and this value is then to be stored in the mysql table.
Now, I would like to add 30 days to the current time if this value is not entered by the user. This can be thought of as a default expiry date which is 30 days from the current date.
Keeping this in mind, what would be the ideal datatype that i should be using in Mysql database. I'LL NEED TO COMPARE THIS VALUE WITH THE CURRENT DATE everytime I lookup something in that table, TO CHECK WHETHER THE EXPIRY DATE HAS PASSED .
Guide me on this.
Thanks,
Kunal
Now, I would like to add 30 days to the current time if this value is not entered by the user. This can be thought of as a default expiry date which is 30 days from the current date.
Keeping this in mind, what would be the ideal datatype that i should be using in Mysql database. I'LL NEED TO COMPARE THIS VALUE WITH THE CURRENT DATE everytime I lookup something in that table, TO CHECK WHETHER THE EXPIRY DATE HAS PASSED .
Guide me on this.
Thanks,
Kunal