insert webform component values into a custom table
I would suggest taking the data straight out of the webforms DB tables.

To understand how to do that we need to look at how data is stored in the DB.

Each time a new webform is created a row for it is created in the webform table. Each webform has a unique identifier called nid.

Each component added to the webform is stored in the webform_component table and has a unique identifier of cid (cid is only unique per webform, nid is also required to make the primary key).

Now when a user fills in the webform a row is created in the webform_submission table (with a unique id of sid) and each fields value is stored in webform_submitted_data. Each row in the webform_submitted_data table has a nid (the webform ID), sid (submission ID) and cid (the component ID).



So, if you wanted to get all of the data from a particular submission with the name of the field (or component), uid and the data submitted you can use the following query:

SELECT c.`name`, sd.`data`, s.uid
FROM webform_submitted_data sd
INNER JOIN webform_component c ON c.cid = sd.cid AND c.nid = sd.nid
INNER JOIN webform_submissions s ON s.sid = sd.sid
WHERE sd.sid = {YOUR SUBMISSION ID}


Or to show all of the values submitted for a particular field with uid and date then you could use:

SELECT sd.`data`, s.uid, s.submitted
FROM webform_submitted_data sd
INNER JOIN webform_component c ON c.cid = sd.cid AND c.nid = sd.nid
INNER JOIN webform_submissions s ON s.sid = sd.sid
WHERE sd.cid = {YOUR COMPONENT ID}