rupam_jaiswal Posted June 13, 2010 Share Posted June 13, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/204628-hotw-to-get-rows/ Share on other sites More sharing options...
fenway Posted June 15, 2010 Share Posted June 15, 2010 Show us your existing query. Quote Link to comment https://forums.phpfreaks.com/topic/204628-hotw-to-get-rows/#findComment-1072356 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.