2

I need webform submission data to be inserted into an external sql database. How would I go about doing this? Would this be a custom module, or be processed in template.php? I am having trouble understanding how I can capture that data and have it sent over to an external database.

1

Usually the first step to solving a problem like this in Drupal is finding the right hook.

A quick google search for "webform hooks", and then we pick the hook where we'd have access to the completed webform's data: http://api.lullabot.com/hook_webform_submission_insert/7

The example on that page happens to be exactly what you want to do!

  • When adding a field to be inserted, as in the example from that link you provided, how do I write my own fields? 'foo' => 'foo_data', How would I add a field called first_name? 'first_name' => 'first_name', doesn't work. – jose Mar 5 '12 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.