The best way to store subscribed information

I have a table of “users” and every user can subscribe to multiple topics.
What is the best way to store the user subscribed “topics” in a table?

Tell me if there is a better solution than this:
Insert a new row every time a user subscribe to a new topic. for example:

userID | topicID
1 | 3342
1 | 4342
2 | 1343
3|  532432
3| 343
3| 3434
3| 3443

what you have there is the best way

make sure you declare this –

PRIMARY KEY ( userID , topicID )

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.