I have three tables:
- post
- tags
- past_tags
So, I want to make a simple search to get the post ID using it's title only, related tags only, and title and tag.
To explain my point take this example:
In post table I have columns named (post_id, post_title)
Example: post_id: 1 - post_title: my new super car
In tags table I have columns named (tag_id, tag_name)
Example: tag_id: 5 - tag_name: red
In post_tags I record the post_id of "post" and the tag_id of "tag":
Example: post_id: 1 - tag_id: 5
so each post can has many tags (a simple relationship).
I want to select the post post_id if I enter any of these queries:
- supper car
- red car
- red super car
- super red car
- red
It's a kind of merging the results and match the post_id even if the query is not related to one column.
Thank you.