Check my other question with bounty: Finding similar number patterns in table
I'm trying to implement an Interesting Tags feature. For reference, this is how it works on SO:
- I add into the "interesting" list my interested tags (like php, mysql, jquery and so on).
- Then, if any of the displayed questions has some of the tags in my list, it makes the background orange.
I understand how to use jQuery to do that (there are related questions on that), but can't figure out how to implement the back-end portion using MySQL!
So here's my question: How is it done? I imagine it working like this:
- There is a row in mysql for every member, let's call it "interested_tags".
- After I write and submit my tag through input, it is being written in a row "interested_tags".
Then, the main page has a query which shows all answers and it always checks question's tags with mine tags using strpos like this:
if(strpos($question_tags, $my_tags) === true) { //and here will be made background orange }
Am I thinking right or is there any way to do it?
EDIT: So, can you show me an example or give me some tips how to implement this with many-to-many relationships? Thanks.