Jump to content


Photo

MySQL tables ..making a bulletin system


  • Please log in to reply
1 reply to this topic

#1 techiefreak05

techiefreak05
  • Members
  • PipPipPip
  • Advanced Member
  • 494 posts
  • LocationER, MN

Posted 08 September 2006 - 02:37 AM

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:

mysql_query("SELECT * FROM `bulletins` WHERE `from` = ??") or die("There was an error showing your buletins");

i want to put seomthing that means "a friend of yours" where i have "??"



Link shortener with advanced, detailed statistics:

http://tyny.us/

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 September 2006 - 03:02 AM

Providing you have all your frineds id's, something like this would do it.

mysql_query("SELECT * FROM `bulletins` WHERE `from` IN(3,18,9,5,10)") or die("There was an error showing your buletins");

However you would more likely want to use some sort of join to get your frineds id's and there posts into one query.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users