Jump to content

Recommended Posts

HI,

In mysql, I have 2 tables friends, my_page.

 

friends

--------

id int(11)

username  char(40)

person char(40)

type enum('Friend','Blocked')

 

id username person  type

------------------------------------------------------

13 king_nothing Musechild Friend

587 MrRogue ammo         Friend

17 Honey MrRogue Friend

 

 

my_page

--------

id int(11)

username  varchar(30)

page_owner varchar(30)

date_posted datetime

text text

 

id  username     page_owner text date

------------------------------------------------------------

4    Honey     MrRogue PHP 2010-06-11 12:30:18

5    ammo     MrRogue java 2010-06-08 10:54:52

6    mobster        ammo both 2010-06-12 21:20:14

7    ammo     Wizkid wrong 2010-06-12 21:39:29

8    Honey     ammo show 2010-06-12 22:28:52

 

friends table tells freinds of each member,

say MrRogue is friend of ammo, Honey.Note that MrRogue can come in either username/person field, not necessarily to be in username field.

 

Now I want rows from my_page where my_page.username, my_page.page_owner both are friends of MrRogue, like

 

8    Honey     ammo show 2010-06-12 22:28:52

 

Thanks in advance!!!!

Regards

Link to comment
https://forums.phpfreaks.com/topic/204628-hotw-to-get-rows/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.