I am looking for a module that meets the following:

1. It can build forms (like Webform)
2. The data must be stored in a table in the database
3. The must be extractable, so that I can display it on a page
3.1 It is OK if it is only possible to extract and display the data through custom php/sql query

It is not possible to extract and display the date with the Webform module (as far as I can tell).

Does this module exist or can anyone tell me about a work-around?

Regards
Kasper K

Comments

Kasper K’s picture

Anyone?

bshetty’s picture

Hi Kasper,

Could you please elaborate as to what data you want to extract from db so that I can help you better (if possible)!

Also, I am hoping you are using latest version of Webform Module because if you want to custom your webform, mail, results etc would find fairly many options in the configuration page (in edit page) and if you want to achieve a major customization that can also be done using the latest version.

This is the latest one for Drupal 6 http://drupal.org/node/947602

Regards,
BShetty

Kasper K’s picture

Hi BShetty

I have set uo a form that works just as it should. It is textfields, a textarea, a file field, and two date fields. The data goes nicely to the database when submitting.

So I want to extract that data into another page, but as I see it, webform doesn't create a new table for that specific form, it just fills the data into the webform_submitted_data table and from there I find it quite difficult to extract the data into another page.

Hope that explains it better :-s

Regards
Kasper

Kasper K’s picture

In basic what I want is, a form creator that creates a table each time a new form is created, so that the field names in the form are the same as those in the table.

That is most likely not possible, but anything that looks a little bit like that will be most welcome.

Regards
Kasper K

bshetty’s picture

Hi Kasper,

I have this piece of code which would get the data in submitted forms in a variable in an array. Also as it is a db query you can use it in your custom module or theme it would work in both. :)

  // db query to get all sids (submitted webforms) present in nid = '12345' (put your webform's nid here instead of 12345)
  $webform_sids = db_query("SELECT sid FROM {webform_submitted_data} WHERE nid = '12345'");
  while ($webform_sid_array_raw = db_fetch_array($webform_sids)) {
    $webform_sid_order[] = $webform_sid_array_raw['sid'];
  }
  $webform_sid_order = array_unique($webform_sid_order);

  // db query to get data on the submitted webforms
  foreach ($webform_sid_order as $webform_each_sid) {
    $webform_data = db_query("SELECT data FROM {webform_submitted_data} WHERE sid = '%d'", $webform_each_sid);
    while ($webform_data_all = db_fetch_array($webform_data)) {
      // this is the variable where you have the data in the submitted webform in an array
      $webform_data_each[$webform_each_sid][] = $webform_data_all['data'];
    }
  }

This is what I have done and it worked for me.

Also I will keep searching for relevant contrib module in my free time and if you come across anything please do share it! :)

Regards,
BShetty

ganbca2003’s picture

I have this similar problem on my site. Now Im developing one construction site. I want to build a webform for enter the details of the single house specification (like plot no, total sqft, amount and image of the house). It was store in database perfectly. I want to display this stored data in specific page like a gallery. how to do this?

I go through your previous code but i don't know where in put this code.

Bcoz im new to web form concepts. Please teach to me step by step ( if u can)...

thanks...