How do I use "IGNORE" in a database query? I would like to run a query similar to INSERT IGNORE INTO the_table (nid, language) VALUES (8, 'Chinese'), but I cannot find any documentation on how the "IGNORE" statement works with the Drupal DB API. 

Does anyone know how to achieve that? 

db_merge('the_table')
  -&gt;key(array('nid' =&gt; 8, language' =&gt; Chinese))
  -&gt;fields(array(
      'nid' =&gt; 8,
      'language' =&gt; Chinese,
  ))
  -&gt;updateExcept('nid','language')
  -&gt;execute();


Would the code above be the equivalent of my initial query ?

EDIT: updateExcept method doesn't exist, no idea why it s still in the documentation
What you want is a MERGE query with no UPDATE part. Something like this should work:

db_merge('the_table')
  -&gt;key(array(
      'nid' =&gt; 8,
      'language' =&gt; Chinese,
  ))
  -&gt;insertFields(array(
    'nid' =&gt; 8,
    'language' =&gt; Chinese,
  ));
  -&gt;execute();