My question is in regards to having an application with two different user types, and each usertype has different "profile fields"(or details to look at it another way). To handle this, I used the "Group" structure to group the users together. I have the following table structure:
User: userid, username, password, groupid;
Group: groupid, detailsid, type, name
user_type1_details: id, other_fields
user_type2_details id, other_fields
Now, to select data from either user_type1_details or user_type2_details, you use the "type" field in the group table.
How do I select all the details data if the user is type 1 ?, How do I query the user_type_details table if the userid is 5, for example? What am I missing here? If the user is of type 1, I want to show all of the user_type1_details for that user, if it is type2, I want to show all of the user_type2_details. The details in each of these two tables are completely different.