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 "??" Link to comment https://forums.phpfreaks.com/topic/20080-mysql-tables-making-a-bulletin-system/ 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. Link to comment https://forums.phpfreaks.com/topic/20080-mysql-tables-making-a-bulletin-system/#findComment-88143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.