I feel that having a different table for each user completely removes the entire purpose of a single source of information.
Now, it feels like I'm missing something here, but to maintain such a structure (especially to simply fetch information across all tables) would be a nightmare.
I'm not saying its right or wrong, I'm saying it feels like a kludge that actually goes against any efficiencies and scalability.
The real solution I think is to add a bit more code and do the UPDATE accordingly. That'll keep the DB consistent, and allow OP to still dyanmically do things in a way that would be scalable going forward. I just got to a hotel after a three hour drive so I need more time to digest this (perhaps OP can share more insight into the reason for needing this extreme conciseness) before I have any formal solution.
Could be trivially easy to add another column to the table, perhaps even comma separated that explains which columns each user can populate by name, then grab that info based on the userid, dump it into a hash, and then you know which columns user X has, and just dump undef, NULL or whatever to the others (again, using UPDATE).
|