tmapm — 2010-02-06T08:46:23-05:00 — #1
I've seen this in Wordpress:
I see that this setup would allow for a flexible way to add additional fields to users without modifying the table structure itself.
Is this an ideal way to setup a table for users that may differ in fields if they are a business or individual? Obviously there would be a basic table for the information all users share (like log in information).
A problem that I see is if I wanted to grab tons of users, it could get a little complicated. At best, I would be able to perform 2 queries, 1 for each table. And then using PHP, join the results together..
r937 — 2010-02-06T08:51:15-05:00 — #2
it does indeed
this scheme is called EAV (entity-attribute-value) and it is deceptively simple to put information into, but frustratingly, maddeningly complicated to get any meaningful information out of
the proper way to handle different user columns as between businesses and individuals is with a supertype/subtype structure
tmapm — 2010-02-06T09:14:21-05:00 — #3
Thanks, that's what I've wanted to know. I'll search the forums to read about supertype/subtype structure and get it set up.