Drupal add possibility to change submission id
Hello everybody 开发者_运维问答and thanks for interest
some time ago i have started to use Drupal, but i am not best programmer, i am learning to be, and now i have one little issue. I am using Drupal 6 and Webform module, where i want to add possibility to webform-results table - what i need is to add row to results table which after click will change submission nid - update mysql webform_submissions table nid to predefined value. (change nid from 21 to 23)
i found webform.result.inc and webform_handler_filed_submission_link.inc files, which displays result table, but i don't knnow how to add this function.
Is it possible and can you somebody help me? I will be very thankful!
A database table has no 'click' event (don't even know where to start correcting that), if you want to change the nid
in webform_results
just run this query:
// Drupal 6
db_query('UPDATE {webform_results} SET nid = %d WHERE nid = %d', $new_nid, $old_nid);
// Drupal 7
db_update('webform_results')->fields(array('nid' => $new_nid))->condition('nid' => $old_nid)->execute();
精彩评论