Hello,
Im trying to make a feed for my website, anyway, what i want it to do is everything from table messages where the userid = the friend id, but what if there is multiple friend id's. sorry if this is a really easy thing, but im a newbie to php / mysql. then i want it to array all the results
this is what ive got so far, it might be completely wrong idno,
<?php
$uid = "$_SESSION[userid]"; // get userid
$friendid = "SELECT * FROM friends WHERE userid='$uid'"; // find friendships
$query = "SELECT * FROM messages WHERE userid='$friendid'"; // 1.
$result = mysql_query($query);
while($r=mysql_fetch_array($result)) // 2.
{
echo "<br><table width='100%'><tr bgcolor='$title_cell_color'><td>
<img src='to do..'><b>to do..</b> posted on to do..</td></tr>
<tr bgcolor='to do..'><td>the auctull message will go here..</td></tr>
</table><br>";
}
?>
so to cap it off, i want to check the database for a list of my friend ids, then select everything from table messages where the userid in that is equal to my friends ids, then array all the results in a table
help please.. been trying to get it to work for a few days now
Thanks :)
Mackey