techiefreak05 Posted September 8, 2006 Share Posted September 8, 2006 im in the proccess of starting a bulletin system where users store their bulletins in the "bulletins" table ...now.. how would i only show the bulletins by the users' friens.. the users are stored in the table "users" and the friends conenctions are stored in the "friends" .. i want to have a query like this to show your friends bulletins:[code]mysql_query("SELECT * FROM `bulletins` WHERE `from` = ??") or die("There was an error showing your buletins");[/code]i want to put seomthing that means "a friend of yours" where i have "??" Quote Link to comment Share on other sites More sharing options...
trq Posted September 8, 2006 Share Posted September 8, 2006 Providing you have all your frineds id's, something like this would do it.[code]mysql_query("SELECT * FROM `bulletins` WHERE `from` IN(3,18,9,5,10)") or die("There was an error showing your buletins");[/code]However you would more likely want to use some sort of join to get your frineds id's and there posts into one query. Quote Link to comment 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.