Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6755515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:24:38+00:00 2026-05-26T13:24:38+00:00

I am absolute beginner to drupal. I have added a contact form (using Webform

  • 0

I am absolute beginner to drupal.

I have added a contact form (using Webform module).

Now I want to save the data entered in the form. But I am lost. I have searched over internet, found db_query() is used to query database.

But I dont know where to write the php code. Please help me or if you know any link,please give me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:24:38+00:00Added an answer on May 26, 2026 at 1:24 pm

    The tables you’ll be most interested in are webform, webform_submissions, webform_submitted_data and webform_component. Have a look at those tables and it becomes very obvious how they’re linked together.

    You’ll want to look at the Drupal 7 Database API to learn how to use the query system but here’s an example to get you going:

    /* Get a list of all submissions from webform for the node with ID (`nid`) of 1 */
    $nid = 1;
    $submissions = db_select('webform_submissions', 'ws')
      ->fields('ws')
      ->condition('nid', $nid)
      ->execute();
    
    /* If you want to use db_query and a plain old SQL statement instead you'd do it like this: 
    $submissions = db_query('SELECT * FROM webform_submissions WHERE nid = :nid', array('nid' => $nid)); */
    
    /* Loop through the submissions and load up the submitted data for each */
    $submission_data = array();
    foreach ($submissions as $submission) {
      $query = db_select('webform_submitted_data', 'wsa')
        ->fields('wc', array('name'))
        ->fields('wsa', array('data'))
        ->condition('sid', $submission->sid);
    
      /* Join in the component table to get the element label */
      $query->join('webform_component', 'wc', 'wc.nid = wsa.nid AND wc.sid = wsa.cid');
    
      $submission_data[] = $query->execute()->fetchAllKeyed();
    
    }
    

    At the end of that code you’ll have an array ($submission_data), which contains a list of arrays of submission data for the provided node. Each of those arrays’ items has a key of the component label, and a value of the submitted user value.

    Hope that helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm an absolute beginner using Joomla. I'm trying to load a module within another
Absolute beginner question: I have a template file index.html that looks like this: ...
I'm an absolute beginner, you see. Say I have a string object on the
I'm an absolute beginner when it comes to using both SWIG and lua, and
I want to develop a website with java but I'm absolute beginner in java
I have a form field in Drupal which I need some help with. The
I'm an absolute beginner using IDLE (Python 2.6.4) to learn the basics. I recently
First of all I want everyone to know that I am absolute beginner so
I am an absolute beginner in this field. I have written the following code
I am an absolute beginner. Never made a classifier or anything in weka using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.