Ok I have two tables, one of which is called account_members , and the other is account_follows . I want the Twitter system to use the following system in which account_members can follow each other.
Account Follows Table Structure: id account_name followed_name time Account Members Table Structure: id Account_name status (Account active or not)
It seemed to me that I could get away with one simple request to get all the accounts:
public function following($account_name) { $sql = "SELECT F.id, F.account_name, F.followed_name, F.time, M.account_name AS session_name, M.status FROM account_follows F LEFT JOIN account_members M ON F.account_name = M.account_name WHERE F.account_name = :account_name AND M.account_name = :account_name ORDER BY id DESC LIMIT 5"; }
All accounts will be displayed here followed by ( $account_name set via the URL)
The problem I am facing allows me to register with account_member the ability to track or unsubscribe friends of friends they follow. I am doing a simple check for the one registered with account_member to unsubscribe from any of their list by following these steps:
if($_SESSION['account_name'] == $row['account_name']) { echo'<a href="" id="..." class="...">Unfollow</a>'; }
The above works fine, but I want to do something similar with the followers registered in the accounts ... If that makes sense?
So, Bob is logged in, and Bob scans his next list and clicks mike , and sees who is mike strong>, and from this list can follow / unsubscribe from mike (and some of which Bob can follow)
Any help or guidance appreciated.
source share