Soo I've been working on this website programming project for a few weeks now with very minimal problems during the process until now. I'm trying to build a website that can function somewhat like Twitter, Tumblr, and various blog websites. The basic functionality that I am looking for is for user_1 to be able to "follow" user_2. By user_1 clicking the "follow" button, I would like to have an email or private message(also needed for my website) sent to the user_2 stating that user_1 has followed them without need for confirmation from user_2. Like on tumblr, I'd really like the follower(user_1) to receive notifications through either a notification system like that of Facebook or a private message to their account when the followed(user_2) posts anything to their account. There are so many aspects to my website that I need a little help with, so it would be greatly appreciated if someone could help me out. I've tried one method, but for some reason I just can't figure out how to make it work like I want it to.
Right now, I have a table called "followers" with id, user_1_id, and user_2_id, and date. I'm not quite sure where to go from here for some reason - my mind is blank... possibly from staring at this for days now lol. I can't seem to figure out how to get both user_1's id and user_2's id from the same script unless i write the href="profile.php?id='.$id.'" which I'm pretty sure that's not the right way to do it.
I can provide my code if needed, but it's very long.
Please help! Thank you!!!