Now I want to give the user the opportunity to add tags to his "favored tags list". Then the user should only see news articles which contain one of the favored tags air max 90 women's.
Assuming the user Bob has favored the tags "barack obama", "nba", "new jersey" and "dogs" airmax 2010 red black & white. He should only see articles containing at least one of these four tags.
How could I code a PHP/MySQL script which achieves this? I think my database structure is not adequate for this purpose air max 95, is it? I would have to make DB queries like this:
"SELECT FROM news WHERE id IN (SELECT article FROM tags WHERE tag IN ('barack obama', 'nba', 'new jersey', 'dogs'))"
This query would run for a long time, wouldn't it? There must be a database structure which is more appropriate than mine air max for women. Do you have an idea for this problem? Which DB structure do I need and what queries must I use then?
|