www.loltestab.fora.pl Forum Index www.loltestab.fora.pl
Just a simple test
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   GalleriesGalleries   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Articles which contain favored tags-spun1

 
Post new topic   Reply to topic    www.loltestab.fora.pl Forum Index -> Forum testowe
View previous topic :: View next topic  
Author Message
cheapbag214s




Joined: 27 Jun 2013
Posts: 17953
Read: 0 topics

Warns: 0/5
Location: England

PostPosted: Fri 15:48, 16 Aug 2013    Post subject: Articles which contain favored tags-spun1

Articles which contain favored tags,[link widoczny dla zalogowanych]
Now I want to give the user the opportunity to add tags to his "favored tags list",[link widoczny dla zalogowanych]. Then the user should only see news articles which contain one of the favored tags,[link widoczny dla zalogowanych].
Assuming the user Bob has favored the tags "barack obama",[link widoczny dla zalogowanych], "nba",[link widoczny dla zalogowanych], "new jersey" and "dogs". 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,[link widoczny dla zalogowanych], 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',[link widoczny dla zalogowanych], 'nba',[link widoczny dla zalogowanych], 'new jersey',[link widoczny dla zalogowanych], 'dogs'))"
This query would run for a long time,[link widoczny dla zalogowanych], wouldn't it? There must be a database structure which is more appropriate than mine. Do you have an idea for this problem? Which DB structure do I need and what queries must I use then?
相关的主题文章:


[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]

[link widoczny dla zalogowanych]


The post has been approved 0 times
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.loltestab.fora.pl Forum Index -> Forum testowe All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

fora.pl - załóż własne forum dyskusyjne za darmo
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin