Jump to content

Archived

This topic is now archived and is closed to further replies.

techiefreak05

MySQL tables ..making a bulletin system

Recommended Posts

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 "??"


Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

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.