title: Is there a more efficient way to compress these mysql queries?
body: <p>Say if I want to get 100 different users from the same table, I would have to create 100 different queries like below. I am only showing three queries as an example but you get my meaning. </p>
  
  <p>I am wondering if there is a more efficient way to get as many users as I want from the same table? Important thing is that I need to have each user with their unique handle. For eg. $matrix_user_id_2, $matrix_user_id_3, $matrix_user_id_4.  How can I go on about doing that? </p>
  
  <pre><code>$find_sponsor_2 = $db-&gt;prepare("SELECT user_id, filled_positions FROM matrix_2 WHERE user_id = :user_id");
  $find_sponsor_2-&gt;bindValue(':user_id', 2);
  $find_sponsor_2-&gt;execute();
  $result_sponsor_2 = $find_sponsor_2-&gt;fetchAll(PDO::FETCH_ASSOC);
  if(count($result_sponsor_2) &gt; 0) {
    foreach($result_sponsor_2 as $row) {
      $matrix_user_id_2         = $row['user_id'];
      $filled_positions_2         = $row['filled_positions'];
    }
  } else {
    $errors[] = 'User Id 2 not found in Matrix.';
  }
  
  $find_sponsor_3 = $db-&gt;prepare("SELECT user_id, filled_positions FROM matrix_2 WHERE user_id = :user_id");
  $find_sponsor_3-&gt;bindValue(':user_id', 3);
  $find_sponsor_3-&gt;execute();
  $result_sponsor_3 = $find_sponsor_3-&gt;fetchAll(PDO::FETCH_ASSOC);
  if(count($result_sponsor_3) &gt; 0) {
    foreach($result_sponsor_3 as $row) {
      $matrix_user_id_3         = $row['user_id'];
      $filled_positions_3         = $row['filled_positions'];
    }
  } else {
    $errors[] = 'User Id 3 not found in Matrix.';
  }
  
  $find_sponsor_4 = $db-&gt;prepare("SELECT user_id, filled_positions FROM matrix_2 WHERE user_id = :user_id");
  $find_sponsor_4-&gt;bindValue(':user_id', 4);
  $find_sponsor_4-&gt;execute();
  $result_sponsor_4 = $find_sponsor_4-&gt;fetchAll(PDO::FETCH_ASSOC);
  if(count($result_sponsor_4) &gt; 0) {
    foreach($result_sponsor_4 as $row) {
      $matrix_user_id_4         = $row['user_id'];
      $filled_positions_4         = $row['filled_positions'];
    }
  } else {
    $errors[] = 'User Id 4 not found in Matrix.';
  } 
  </code></pre>