I was designed a database model for my social network project. It has follower system. If you follow him the follower can see the status. All these operations are for one page. (This page is name user_wall.php) Its has a GET value and this is userName.
For this case about the two tables; follower , status
follower
=============
id (auto_increment) primary key
owner_id
target_id
status
=============
id (auto_increment) primary key
posted_id
target_id
status_content
vote_up
vote_down
ddate
I had written a code. This is working but just among followers.
1) Current page member get information
$usrInfo = $mdb->queryFirstRow("SELECT * FROM usr WHERE usr_name=%s",$_GET['userName']);
2) That lists the status section the following
$statusList_tbl = $mdb->query("
SELECT status.* FROM status
INNER JOIN follower ON status.owner_id = follower.posted_id
WHERE status.owner_id = %i OR status.target_id = %i
ORDER BY id DESC",$usrInfo['id'],$usrInfo['id']);
Note: I am using MeekroDB (www.meekro.com)Emphasized Text Here
After basic listing.
How to do work without among followers in one page or more page?
Thank you for interest.
Best regards..