Update webform submission pragmatically

Public

Update webform submission pragmatically

Get raw version
php
  1. function foo_webform_submission($nid, $sid , $field_key, $value) {
  2. $query = "select cid from {webform_component} where nid = %d and form_key='%s'";
  3. $cid = db_result(db_query($query, $nid, $field_key));
  4. db_query("update {webform_submitted_data} SET data='%s' where sid = %d AND cid = %d", $value, $sid, $cid);
  5. }