title: Search for the existance of many objects in a database
body: <p>Say I have a database with 5 million users, with the columns</p>
  
  <p><code>id (unsigned int, auto-increment), facebook_id (unsigned int), and name (varchar)</code> </p>
  
  <p>In a program, I have a list of a variable amount of users from a person's facebook friend list (generally ranging from 500-1200 different facebook ids).</p>
  
  <p>What's the most efficient way to send a query to my database that returns the facebook_id's of all of the users where that same facebook_id exists in the database?</p>
  
  <p>Pseudo-code:</p>
  
  <p><code>$friends = array(12345, 22345, 32345, 42345, 52345, ... ~1000 more);
  $q = mysql_query("SELECT * FROM users ...");
  $friendsAlreadyUsingApp = parseQuery($q);</code></p>