title: drupal insert or update DB record with only one function
body: <p>similar quest is here: <a href="https://stackoverflow.com/questions/5825337/help-with-db-query-in-drupal-if-exists-update-else-insert">Help with db query in drupal - if exists update else insert</a></p>
  
  <p>But <em>drupal_write_record()</em> third argument is to determine update or insert. Maybe drupal has another function, who self determine insert or update by primary key? Or I should it to program my self?</p>