lundi 27 juin 2016

how can I combine multiple php mysql table with conditions

I have six tables

Friends:

time int(11) not null MUL

id int(225) not null auto_increment PRI to varchar(225) not null

from varchar(225) not null

ok varchar(225) not null


Updates

statuse_id int(11) not null auto_increment PRI

user text null

time text null

msg text null

catid int(225) not null default '0'

picid int(225) not null default '0'

title text not null

img varchar(500) not null default '0'

Group

id int(11) not null auto_increment PRI

logo varchar(128) null

name varchar(128) null

about varchar(250) null

all int(11) not null default '1'

user int(11) not null default '0' MUL

time int(11) not null default '0'

Page: id int(225) not null auto_increment PRI

sname varchar(225) not null

sdescription varchar(225) not null

suser varchar(225) not null

sdp varchar(225) not null

time int(225) not null

sm int(225) not null default '0'

sv int(225) not null default '0'

hide int(225) not null default '0'

postallow int(225) not null default '0'

pin varchar(225) not null

Group memeber

user int(11) not null default '0'

groupid int(11) null

time int(11) not null MUL

id int(255) not null auto_increment PRI

check int(11) not null default '0'

Page member

userid bigint(20) not null MUL

postid varchar(250) not null default '0'

id int(100) not null auto_increment PRI

time varchar(250) not null

catid int(200) not null

type varchar(200) not null

stationid int(225) not null default '0'

viewers int(250) not null default '0'

I want all my friends to be able to see my updates: friends table and updates table. Secondly I want to display all the post of a page and a group that I joined in my updates. Thanks you so much as you help.

Group membership is checked by check=1, user=me

page membership is checked by viewers='1' and userid='me' and postid=0.

Friends is checked by ok=1 and to=me.

I have been in this for two months. Help me out

Aucun commentaire:

Enregistrer un commentaire