Answer the question
In order to leave comments, you need to log in
How to organize the storage of users in a database with different fields?
There is a table with users. Half of the users will have one field, others will have others (ala employers and job seekers). In fact, two different groups of users, each have their own individual fields to fill out.
I found just such a scheme
But it is for goods. It is clear that it can be adapted for users. But is it logical to do so? In this scheme, it is calculated for a mass of different products and options. I plan to create only two types of users with their own fields.
I wonder how it is organized, for example, on the site "freelance" and others.
Answer the question
In order to leave comments, you need to log in
For example: create a table user (id, username, userpass ... foreignkey) and two tables such as candidates and employer with corresponding (different) fields. Using crosstable + foreignkeys we create dependencies between users and groups.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question