I am not sure if my method is the correct way of doing this in terms of my mysql schema because it is proving difficult as a user could have up to three tags and a post can also have up to three tags.
For example if a post has tags; Music, Technology. And a user has tags Music, Sports. The user would be able to see that post as the tag Music exists in both, the user profile and the post.
My tables are as follows:
Profile has columns:
Profile_id | tag1 | tag2 | tag3
Post has columns:
post_id | author | item | tag1 | tag2 | tag3.
Each tag in the table is related to a specific tag. E.g. tag1
= Music, tag2
= Sports etc.
A tag is inserted in the table dependant on whether the user ticks it when editing their profile or making a post, so tag could have a value NULL
.