I was just curious how the rest of you would go about tackling this situation.
Instead of creating a hardcoded profile table for the members of my current projects web site, I'd like to leave it dynamic. Easy to change, without modifying the code or SQL tables. So off the top of my head, I figured two tables; one holds the field information (fid, name, description) such as 'full name', 'location' etc. The other would hold the data (uid, fid, content).
Within seconds of this idea though I realized how disorderly this could wind up as I wouldn't be able to set the field type of 'content' in the second table. It would have to be a data type that could hold any amount of information, of string, character, or integer values. A 'type' enum column would have to be added to the first table, and error checking to validate the various types would have to be built into the script.
Not a difficult task, but I'm willing to bet there's a better way of doing this. Any suggestions?
apparently this is a common thing to invent and it never works properly as it is impossible to implement.
This talks about it http://www.sitepoint.com/forums/showthread.php?t=606735
The articles mentioned by rudy / r937 show problems with this approach.
(I just changed from one forum to the other and read the same question in each!)