【问题标题】:Saving drupal webform data to a database将 drupal webform 数据保存到数据库
【发布时间】:2010-09-07 07:28:55
【问题描述】:

我使用 Drupal 6.19 版和 Drupal 中的 webform 模块来创建表单。我的站点上有两个表单。当用户提交表单时,drupal 数据库中为每个表单保存的条目在哪里?

请帮忙 谢谢你

【问题讨论】:

    标签: php database drupal drupal-6 drupal-modules


    【解决方案1】:

    只需在webform.install 中查看它的数据库架构。

    ...
    $schema['webform_submitted_data'] = array(
        'description' => 'Stores all submitted field data for webform submissions.',
        'fields' => array(
          'nid' => array(
            'description' => 'The node identifier of a webform.',
            'type' => 'int',
            'unsigned' => TRUE,
            'not null' => TRUE,
            'default' => 0,
          ),
          'sid' => array(
            'description' => 'The unique identifier for this submission.',
            'type' => 'int',
            'unsigned' => TRUE,
            'not null' => TRUE,
            'default' => 0,
          ),
          'cid' => array(
            'description' => 'The identifier for this component within this node, starts at 0 for each node.',
            'type' => 'int',
            'size' => 'small',
            'unsigned' => TRUE,
            'not null' => TRUE,
            'default' => 0,
          ),
          'no' => array(
            'description' => 'Usually this value is 0, but if a field has multiple values (such as a time or date), it may require multiple rows in the database.',
            'type' => 'varchar',
            'length' => 128,
            'not null' => TRUE,
            'default' => '0',
          ),
          'data' => array(
            'description' => 'The submitted value of this field, may be serialized for some components.',
            'type' => 'text',
            'size' => 'medium',
            'not null' => TRUE,
          ),
        ),
        'indexes' => array(
          'nid' => array('nid'),
          'sid_nid' => array('sid', 'nid'),
        ),
        'primary key' => array('nid', 'sid', 'cid', 'no'),
      );
    ...
    

    【讨论】:

    • 您能告诉我webform_submissionswebform_roles 这些表的架构吗?谢谢。
    • 嘿嘿,我就是想知道上面两张表的schema。如果可以请告诉我。谢谢。
    • 表模式都定义在webform.install文件中,看看那里。
    • 哦,我明白了。我想我已经读过了,但不幸的是忘记了那部分。再次感谢队友。 :)
    【解决方案2】:

    你应该使用:

    首先,登录mysql

    之后,使用database_name;

    您必须替换为数据库的名称

    然后,显示表格;

    最后一句会告诉你数据库的表

    现在,从 webform_submitted_data 中选择 *;

    您应该能够看到数据。

    【讨论】:

      【解决方案3】:

      您还可以通过导航到内容管理 > 网络表单来查看提交的数据。我相信数据在数据库中是序列化的,所以如果你有很大的表格,它不容易阅读。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-11-22
        • 1970-01-01
        • 1970-01-01
        • 2012-07-21
        • 2019-03-31
        • 2013-04-06
        相关资源
        最近更新 更多