Save "last update" for a LOT of columns

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
stockholm
Forum Newbie
Posts: 3
Joined: Wed Dec 03, 2008 7:46 am

Save "last update" for a LOT of columns

Post by stockholm »

Hi together,

I just got a real problem, but I hope theres an easy way to do this. Currently, I'm developing a community-like website with lots of profile-content (like gender, smoker, city, got childs, ...). My boss want to ask at specific intervals again for already entered data, just for validation and stuff like this.

Because I know I can't explain things good, here some examples:

User selected "I got no childs yet"
User selected "I'm a smoker"
User selected "I like to drive a car"

Now, i.e. after 1 year, I may want to ask the user again if he still got no childs, is still smoking and loves to drive his car. Idea was to create an "last_update" field for every column, but thats simply impossible with 50-100 columns (seperated to 4 or 5 tables like "profile_basics, profile_interessts", ...) - another idea was to create (this was my boss idea, no mine!) a table for every (!) interessent or "checkbox" I want to keep trackin... but this sounds even crazier.

Long story short:
How to get the time of the last update of a field (column)?

So, I really hope you guys can help me with his matter,

Thank you,
stockholm
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Save "last update" for a LOT of columns

Post by papa »

MySQL ?

What does your table look like now ?
stockholm
Forum Newbie
Posts: 3
Joined: Wed Dec 03, 2008 7:46 am

Re: Save "last update" for a LOT of columns

Post by stockholm »

papa wrote:MySQL ?
Yes

The tables are just nothing special, something like:
CREATE TABLE IF NOT EXISTS `users_profiles_communications` (
`pk_upco` int(10) unsigned NOT NULL,
`fk_users` int(10) unsigned NOT NULL,
`mobile_network` tinyint(3) unsigned NOT NULL,
`mobile_provider` tinyint(3) unsigned NOT NULL,
`mobile_contract` tinyint(1) unsigned NOT NULL,
`mobile_payments` int(5) NOT NULL,
`internet_type` tinyint(3) unsigned NOT NULL,
`internet_provider` tinyint(3) unsigned NOT NULL,
`internet_payments` int(5) unsigned NOT NULL,
PRIMARY KEY (`pk_upco`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Post Reply