Title: db7_forms structure
Last modified: March 4, 2018

---

# db7_forms structure

 *  [technotron](https://wordpress.org/support/users/technotron/)
 * (@technotron)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/db7_forms-structure/)
 * Hi,
 * Please can you clarify the structure of the db7_forms table. In my Contact Forms
   List in WordPress I can see 5 forms types listed.
 * I want to query the data in each of the contact form types. ie. I have a form
   type called ‘People’ and 20 of forms completed with data being submitted.
 * I used the query:
 * global $wpdb;
    $table_name = $wpdb->prefix.’db7_forms’; $total_query = “SELECT
   COUNT(*) FROM $table_name”; $total = $wpdb->get_var( $total_query ); echo $total;
 * And it returned ’55’ and I have 5 contact form types and yes there are 55 sets
   of data accross all 5 of them in total.
 * People 20 form submissions
    Test 10 form submissions Green 10 form submissions
   Red 10 form submissions Blue 5 form submissions
 * However I would like to query the data in one of the 5 types for example in the‘
   people’ form submissions there is a field named ‘surname’. How can I either list
   the 20 surnames? or query each of them?
 * I used this:
 * $table_name = $wpdb->prefix.’db7_forms’;
    $post = $wpdb->get_results(“SELECT *
   FROM $table_name WHERE Name = ‘People'”); echo “
 *     ```
       ";
       print_r($post);
       echo "
       ```
   
 * “;
 * And just get the text ‘Array()’
 * As I see it the structure is db7_forms-people-surname-data. is this right?
 * Any help appreciated.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Arshid](https://wordpress.org/support/users/arshidkv12/)
 * (@arshidkv12)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/db7_forms-structure/#post-10097206)
 * You want query with post_id (custom post type cf7) and unserialize.

Viewing 1 replies (of 1 total)

The topic ‘db7_forms structure’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-cfdb7/assets/icon-256x256.png?rev=1619878)
 * [Database Addon for Contact Form 7 - CFDB7](https://wordpress.org/plugins/contact-form-cfdb7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-cfdb7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-cfdb7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-cfdb7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-cfdb7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-cfdb7/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Arshid](https://wordpress.org/support/users/arshidkv12/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/db7_forms-structure/#post-10097206)
 * Status: not resolved