In this case, it is better to create a table in mysql: a user can subscribe to multiple emails and the functions required are as follows: A user can obtain the Mail type subscribed by this user. I can query the Mail type to find out which users have subscribed to this mail. how can I create a table? & nbsp; my idea is to create a user subscription table and a mail table. a field in the user subscription table stores all the email IDs subscribed to by this user & nbsp; however, in this case, it is better to create a table in mysql.
Condition: A user can subscribe to multiple emails.
The required functions are as follows:
A user can obtain the Mail type subscribed by this user.
I will query a mail type to find out which users have subscribed to this mail.
In this case, it is more appropriate to create a table.
My idea is to create a user subscription table and a mail table.
In the user subscription table, a field stores all the email IDs subscribed by the user.
But there is a problem.
Check this user so that you can easily know the type of the user subscription.
If you want to check the mail type, it is troublesome to query which users have subscribed to this mail.
Do you have any good ideas about table creation?
------ Solution --------------------
Three tables can be created;
1 User table;
A Mail category table;
Subscribe to The Mail record table in a user;
This operation and expansion are both convenient.
------ Solution --------------------
Three tables:
User table, email table, and user subscription table
The first two you know
The user subscription table has two fields: user id and email id.
From the field name, you should know how to do it.
------ Solution --------------------
You can use fuzzy search, regular expression, or other methods to query types.
Otherwise, what if there are 0.1 million categories (this is not a large number and there are more newsgroups than this?