title: MySQL Insert to with Multiple Checks
body: <p>In a facebook app he have the following DB columns:</p>
  
  <pre><code>id (auto_increment)
  facebook_id (VARCHAR)
  email (VARCHAR)
  like_name (VARCHAR)
  like_id (VARCHAR)
  </code></pre>
  
  <p>If we want to allow multiple entries for the same facebook_id, but not allow duplicates of the like_id for each facebook_id, what would be the query?  We want to allow multiple facebook_id's to have the same like_id.  Do we need to set any indexes?  We tried doing a DUPLICATE KEY Update, but it does not work.</p>
  
  <pre><code>    $likessql = $conn-&gt;prepare('INSERT IGNORE likes (facebook_id,email,like_name,like_id) VALUES(:facebook_id,:email,:like_name,:like_id) ON DUPLICATE KEY UPDATE like_id = :like_id');
      foreach ($likes as $like) {
          $likessql-&gt;execute(array(
          ':facebook_id' =&gt; $facebookid,
          ':email' =&gt; $email,
          ':like_name' =&gt; $like['name'],
          ':like_id' =&gt; $like['id']
      ));
  </code></pre>