Title: Multiple forms submit to one database
Last modified: August 22, 2016

---

# Multiple forms submit to one database

 *  Resolved [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/)
 * I have seven forms. Each one opens opens a pdf brochure unique to that form once
   it has been filled out and SEND is clicked. But I would like the data from the
   forms to all go to the same database, i.e. People who have asked for a brochure.
 * I have seen some discussions about this but I couldn’t understand how to implement.
 * Thank you.
 * [https://wordpress.org/plugins/contact-form-7-to-database-extension/](https://wordpress.org/plugins/contact-form-7-to-database-extension/)

Viewing 15 replies - 16 through 30 (of 44 total)

[←](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/?output_format=md)
[1](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/?output_format=md)
2 [3](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/3/?output_format=md)

 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583757)
 * One other thing, just to be thorough, I am using “Contact Form 7” and “Contact
   Form DB”.
 * Will
 *  [lim sungbeom](https://wordpress.org/support/users/lim-sungbeom/)
 * (@lim-sungbeom)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583758)
 * Hell~ I am late.
    Here is what I want to say detail. (I am sorry to say hard 
   to understand. I am a Korean, So please understand it. )
 *  I made 6 steps contact form for patient.
    I just need not all each step data
   but one combinded record. but, there are 7 record.
 *  1. Result of Performance[](https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/combound-1024x480.jpg)
 *  – 1st : combinded data
    – 2~7th : each original data from 1step to 6step.
 *  2. my coding
 *  function change_title($formData) {
    if ($formData && in_array($formData->title,
   array(‘Medical Record Check’, ‘Medical Record Check 2’, ‘Medical Record Check
   3’, ‘Medical Record Check 4’, ‘Medical Record Check 5’, ‘Medical Record Check
   6’))) { $formData->title = ‘Combined Medical Record Forms’; } return $formData;}
 *  add_filter(‘cfdb_form_data’, ‘change_title’);
 *  * I want to del 2~7th data, because they are just one persons record.
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583761)
 * Lim,
 * This is the same code as Michael Simpson gave me. Thank you. I have put this 
   in the “Add Actions And Filters” plug-in. I am still not getting combined results
   from the six DBs. Apparently there is some kind of flaw in my setup, but I don’t
   know where.
 * Thank you,
    Will
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583762)
 * Michael,
 * I just ran a test where I took the load brochure code out of the contact form
   so I could test to see if that was causing the problem. The Combined Brochure
   DB still did not appear on the list.
 * Thank you,
    Will
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583763)
 * [@will](https://wordpress.org/support/users/will/)
 * You might sanity-check your form names (that there are no spaces in them).
 * You might add:
 *     ```
       $formData->posted_data['Form Name'] = '"' . $formData->title . '"';
       ```
   
 * and do a submission and see what exactly is inside the quotes.
 * PS on_sent_ok is irrelevant
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583764)
 * [@lim](https://wordpress.org/support/users/lim/)
 * I am confused as to whether your are saying that the code does not work or you
   want to delete certain values that are already in the database.
 *  [lim sungbeom](https://wordpress.org/support/users/lim-sungbeom/)
 * (@lim-sungbeom)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583765)
 * Ok, Let me explain detail.
 * The code worked and made 6 records in a db ‘combined medical record check’.
    (
   There are 6 records, firtst line data is a combied data, 5 records are each step
   data from 1step to 5th data )
 * I just need the first line data which is combined.
    But there created 5 line 
   more. I want to delete from 2nd to 6th line or prevent to creat.
 * < picture image>
 * [https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/db-1024×576.jpg](https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/db-1024×576.jpg)
 *  -the first line is the combined data from 1step to 6 step.
    -2 line ~ 6th line
   are record data in each step data
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583766)
 * Michael,
 * No go. I created a no space form name and added it to the code and it still didn’t
   generate the combined database. This is weird and kind of frustrating.
 * I added the code you sent above below the rest of the code but I’m not sure what
   is supposed to happen with that?
 * I have
    Contact Form 7 ver 3.4.2 Contact Form DB ver 2.6.3 Worepress ver 3.6.1
 * Might these be incompatible?
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583767)
 * Looks like you have a very old version of CFDB. Why don’t you update?
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583768)
 * BINGO!
 * Thank you for your patience!
 * Will
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583769)
 * [@lim](https://wordpress.org/support/users/lim/) I think I finally beginning 
   to understand.
 * Looking at your screen shot, I thing you are using Gravity Forms. Is this a multi-
   page form? Is it giving you an entry in the database for each page? I thought
   that Gravity Forms only gave one submission from the last page.
 * I’m still confused about how you got several intermediate form submissions and
   then a final form submission with all the data. But maybe I don’t need to know.
 * If you do not want to capture steps 2-6 then I can suggest these options:
 * 1. Do not use the “change_title” code. Remove it. Go to the CFDB Options page.
   Find the option for names of forms that you do not want to save. Put in “Medical
   Record Check 2,Medical Record Check 3,Medical Record Check 4,Medical Record Check
   5,Medical Record Check 6”. Then only “Medical Record Check” will be saved in 
   the database.
 * 2. If for some reason you need to use the code, know that if you use “return 
   null;” instead of “return $formData” in the function, then no data will be saved.
   You could add logic in the function to have a form save or not based on which
   value it returns.
 * I hope this helps.
 *  [lim sungbeom](https://wordpress.org/support/users/lim-sungbeom/)
 * (@lim-sungbeom)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583773)
 * Thank you for your kindness, Michael Simpson
 *  1) I used ‘Contact Form 7 Multi-Step Forms’ plugin
 *  2) ‘function change_title($formData) ‘ is used for combinding ‘medical record
   steps(from 1 to 6 level)
    because ‘Contact Form 7 Multi-Step Forms’ don’t creat
   combing form data, but creat seperated form data.
 *  3) process
 *  – I did what you said ” delete ‘function change_title($formdata)'” , and set
   do not want to save form which is
    ‘Medical Record Check 2,Medical Record Check
   3,Medical Record Check 4,Medical Record Check 5,Medical Record Check 6’
 *  4) result
 *  – combined data has gone, and each form datas created.
 *  5) P.S
 *  – I tried to set ‘do not want to save form’ without deleting ‘function change_title(
   $formData) but 1~5 form record created also.
 * 6) picture ( for the result)
 * – created step data
 * [https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/medical-record-check-frame-data-1024×440.jpg](https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/medical-record-check-frame-data-1024×440.jpg)
 *  – created step frame detail data
 * [https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/inner-record-1024×440.jpg](https://www.miinfra.co.kr:44373/infra/wp-content/uploads/2015/01/inner-record-1024×440.jpg)
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583774)
 * Michael,
    Just wanted to let you know that my issues are resolved. Your coding
   was right on, it was the update of DFDB that was holding up progress. I have 
   not marked this as resolved since you have Lim’s question still ongoing. Thank
   you, Will
 *  Thread Starter [willbell](https://wordpress.org/support/users/willbell/)
 * (@willbell)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583775)
 * Michael,
 * I lied. I have one more question.
 * Let’s say I have three databases and one combined database consisting of data
   from the three.
 * I am looking at the combined database and I see and entry and I need to know 
   which of the three forms that entry comes from. How do I create a column that
   shows which contact form the entry came from, ie. which of the three databases
   the entry on the combined database comes from.
 * Thank you,
    Will
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/2/#post-5583776)
 * [@lim](https://wordpress.org/support/users/lim/)
 * I’m sorry but I don’t know how to solve this problem. CFDB was not coded without
   taking into account ‘Contact Form 7 Multi-Step Forms’ plugin.

Viewing 15 replies - 16 through 30 (of 44 total)

[←](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/?output_format=md)
[1](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/?output_format=md)
2 [3](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/3/?output_format=md)

The topic ‘Multiple forms submit to one database’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/contact-form-7-to-database-extension_ffffff.
   svg)
 * [Contact Form DB](https://wordpress.org/plugins/contact-form-7-to-database-extension/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-to-database-extension/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-to-database-extension/reviews/)

## Tags

 * [Contact Form DB](https://wordpress.org/support/topic-tag/contact-form-db/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [Merge](https://wordpress.org/support/topic-tag/merge/)

 * 44 replies
 * 4 participants
 * Last reply from: [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/multiple-forms-submit-to-one-database/page/3/#post-5583819)
 * Status: resolved