0

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..

1
Contributor
1
Reply
8
Views
2 Years
Discussion Span
Last Post by fthmad
0

I writed wrong last code, true the following;

$statusList_tbl = $mdb->query("
                SELECT status.* FROM status 
                INNER JOIN follower ON status.owner_id = follower.posted_id 
                WHERE status.posted_id = %i OR status.owner_id = %i
                ORDER BY id DESC",$usrInfo['id'],$usrInfo['id']);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.