title: Exploding String Then Fetching from Database
body: <p>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!</p>
  
  <hr>
  
  <p>Edit: Sorry for being so sparse, it's been a long night of frustration, i'll elaborate.</p>
  
  <pre><code>if ( $follower_array != "" ) 
  {
  
    $followArray = explode(",", $follower_array);
    $followCount = count($followArray);   
    $i = 0;
    $display .= "&lt;table&gt;";
  
    foreach( $followArray as $key =&gt; $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 .= "&lt;td&gt;' .$content. '&lt;/td&gt;&lt;/tr&gt;";
      }
  
      display .= "&lt;/table&gt;";
  }
  </code></pre>
  
  <p>The Database tables are as follows:</p>
  
  <pre><code>members|content
  ---------------
              id |id
  follower_array |mem_id
                 |content
  </code></pre>
  
  <p>follwer array looks like "4,5,6,7" etc.</p>
  
  <p>I have four member id's set in the dummy data. It retrieves those in $followArray</p>
  
  <p>The output is </p>
  
  <ul>
  <li>mem_id:1 - content</li>
  <li>mem_id:2 - content</li>
  <li>mem_id:3 - content</li>
  <li>mem_id:4 - content</li>
  </ul>
  
  <p>but then stops. It only retrieves one content per member when there are more for each user. Thanks I hope I cleared that up.</p>