I have (...well, I WILL have) a script that will log a value to a database and keep it there for 14 days.
After 14 days, it will retrieve the value again, update the database, and update the timestamp.
Can someone please guide me along this process? I mostly need help on the best way to achieve this. I am using "MEDIUMINT" for the column, but that can be changed.
How should I store the timestamp (format?) and which function? I was just reading something about using datetime instead of timestamp or something... is one way better than the other? I don't need it to store the TIME, only the DAY (it will refresh every 14 days)
Any help will be appreciated.
PHP + MySQL + Dates (and using them, not just storing)
Moderator: General Moderators
-
FuzzyLogik
- Forum Newbie
- Posts: 18
- Joined: Tue Dec 12, 2006 12:15 am
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Re: PHP + MySQL + Dates (and using them, not just storing)
Some native type that fits your needs. DATE, TIME, DATETIME, TIMESTAMP, etc...FuzzyLogik wrote:How should I store the timestamp (format?)
Which function for what?FuzzyLogik wrote:which function?
They behave a bit differently in different databases. You should read the documentation on each in your respective database's manual.FuzzyLogik wrote:I was just reading something about using datetime instead of timestamp or something... is one way better than the other?