abcedea wrote:JelvinJS7 wrote:it occurred to me that i may be helping you do something you don't need help with…
I think you may be... :/
I think i talked to much about my example then how to use it, but Yeah I'm very confused… I'm not sure I can help you with this… at least now.
I can't really understand your db picture. I assume you are using phpMyAdmin, so a screenshot of the page on the structure tab would be more clear.
What you could do is use a subscriptions table like I said: one column with the subscribing user's id, then the other with the subscribed user's id. Then the other table stores all posts, marking the ID of the user that posted it.
I assume by profile you mean homepage, and we aren't subscribed to 'user 2'. In which case you first query all IDs that you are subscribed to in the subscriptions table by using your ID in a session, then it takes all (recent) posts that are from those IDs.
<?php
Mysql_query("SELECT `subscribed_id` FROM `subscriptions` WHERE `subscriber_id` = {$session_id}");
//put selected ID into variable
mysql_query("SELECT * FROM `posts` WHERE `poster_id` = {$subscribed_id} LIMIT 5");
//somehow output this
?>
Would be a generic idea to show the past 5 posts from people you've subscribed to. I'd show pictures of what I mean, but I'm on my iPod and it's 2 in the morning.
Does this help? If not, I'll try to clarify or just pass the baton to someone wiser than me