Answer the question
In order to leave comments, you need to log in
What's the best way to make a key-value for a single field in a db?
I can't find the right solution for my problem.
For example, a user can upload his clients, for this the database has the required id and name fields for each client from his database, but it should also be possible to use other data about clients, which for different users can be different and in different numbers .
For example, user A has a database of the form:
name | surname | phone | address
User B's database type:
name | patronymic | age | promo code | machine
In the future, the user should be able to use these values as variables:
Hello $name! You are $yold, your car is $car.
I thought to make a separate variable field in the database and load data there in the form yold:23, car:bmw4, ...
To what extent is this decision correct? Are there other options?
Answer the question
In order to leave comments, you need to log in
Searching and choosing will be problematic.
I would just make a table with variables like
variables: user_id | key | value
There is an option to use key-value storage for key-value data, since you have just such. Why would you try to look up the schema of the data if that schema is not expected? Take Mongu, since the fields about different clients are different.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question