title: Search MySQL database with an array
body: <p>I hope I am doing this correctly..</p>
  
  <p>Using this code I am grabbing records from one table and storing them in an array:</p>
  
  <pre><code>$result = mysql_query("SELECT username FROM '$tbl_name'");
  $storeArray = Array();
  while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
      $storeArray[] =  $row['username'];  
  }
  </code></pre>
  
  <p>The result of the query is (using: <code>print_r($storeArray);</code>):</p>
  
  <pre><code>Array ( [0] =&gt; username1 [1] =&gt; username2 [2] =&gt; username3)
  </code></pre>
  
  <p>I want to use this array to search another table. Improvised code would be:</p>
  
  <pre><code>SELECT * FROM $users_tbl WHERE username = username1, username2, username3
  </code></pre>
  
  <p>Could anyone help me generate the MySQL query that would do this?</p>
  
  <p>I hope this is clear enough..</p>