hbla Posted February 23, 2009 Share Posted February 23, 2009 Hey all, I have a database with people who are subscribing to rss-feeds. Now I want to give each of these people a list of feeds from the database collection that are not yet in their own subscriptionlist. What kind of queries or temporary arrays do in need? There is one table with id, feed-url, username. Of course I could create more tables but I'm not sure wether I need to do that or not. I know how to create a table with unique rss-feeds, but then again some of these results may or may not belong to the sub-list of a certain user. Anybody got an idea? Thanks, Henk Link to comment https://forums.phpfreaks.com/topic/146581-database-problem/ Share on other sites More sharing options...
npsari Posted February 23, 2009 Share Posted February 23, 2009 I think you need to exclude the subscritions and display the ones which are not subscribed to You might have to use LEFT JOIN to join the databases together When the user is logged in, you check his ID and then you display all the RSS feeds which this ID is not assigned to hmm, or simply use EXCLUDE when you get data from the database Perhaps something like that... $q = "SELECT * FROM table_name WHERE user != '$get_user_id' "; Link to comment https://forums.phpfreaks.com/topic/146581-database-problem/#findComment-769615 Share on other sites More sharing options...
hbla Posted February 24, 2009 Author Share Posted February 24, 2009 The query you suggest is not going to work. Users might have the samen subscriptions. Let's say I have users John, Mary and Paul. John subscribes to A,B en C. Mary subscribes to C, D and F, and Paul subscribes to D, G and H. Now I need a query that tells John that he should subscribe to D,F,G and H, but not to C (although Mary subscribes to C). My guess is that a join should work, but I'm not familiar enough with joins. Link to comment https://forums.phpfreaks.com/topic/146581-database-problem/#findComment-769935 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.