I have an array that has userid's. I want to explode that array and fetch everything from the database by that userid. It fetches only 1 entry by each user, rather than every entry from that user. Am I missing something? Thank you!
Edit: Sorry for being so sparse, it's been a long night of frustration, i'll elaborate.
if ( $follower_array != "" )
{
$followArray = explode(",", $follower_array);
$followCount = count($followArray);
$i = 0;
$display .= "<table>";
foreach( $followArray as $key => $value )
{
$i++;
$sql = mysql_query(" SELECT * FROM database WHERE mem_id='$value'
ORDER BY bc_date ASC
LIMIT 50
") or die ("error!");
while ( $row = mysql_fetch_assoc($sql) )
{
$mem_id = $row['mem_id'];
$content = $row['content'];
$display .= "<td>' .$content. '</td></tr>";
}
display .= "</table>";
}
The Database tables are as follows:
members|content
---------------
id |id
follower_array |mem_id
|content
follwer array looks like "4,5,6,7" etc.
I have four member id's set in the dummy data. It retrieves those in $followArray
The output is
- mem_id:1 - content
- mem_id:2 - content
- mem_id:3 - content
- mem_id:4 - content
but then stops. It only retrieves one content per member when there are more for each user. Thanks I hope I cleared that up.
INclause?