PDA

View Full Version : timestamping or alternative.


bazz
11-22-2007, 01:30 PM
Hi guys,

OK I am adding a new feature to my own cms system.

Basically I want to be able to make updated pages for the whole site, which when a certain date arrives, they go live and the old one's are archived.

I guess I need to choose a time stamp and store it in a field of its own but, maybe you have a better suggestion?

bazz

guelphdad
11-22-2007, 03:43 PM
use a datetime I'd think rather than a timestamp. if you update any column in a row with a timestamp then the value of the timestamp is adjusted and surely you don't want that.

then I'd say do your query to pull rows with the greatest datetime value that isn't after today.

so if you have two rows, one that you want archived, you don't need to do anything to it. once the newer date is passed then that is the row that will show up.

just a thought.

bazz
11-22-2007, 07:32 PM
Thanks Guelphdad.

I seem to have been trying to overcomplicate it but I shall try it the way you suggest because it sounds more sensible.

bazz