Jump to content

MySQL tables ..making a bulletin system


techiefreak05

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.