Title: Two Forms One Database
Last modified: March 7, 2017

---

# Two Forms One Database

 *  Resolved [rconnard](https://wordpress.org/support/users/rconnard/)
 * (@rconnard)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/two-forms-one-database/)
 * One more for you Michael.
 * This form I’m working with for our wedding RSVP is working great but it needs
   to be in two languages. I set up the other form with Polylang’s Contact Form 
   7 plugin but it’s saving to a different database.
 * I’m guessing to get them to save to the same database all the fields need to 
   be named the same and then I need to do something like you’ve indicated here:
   [https://cfdbplugin.com/?page_id=747](https://cfdbplugin.com/?page_id=747) but
   I don’t know what!
 * By the way, when I search on this forum it returns results for all forums on 
   the WP site, am I missing something?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/two-forms-one-database/#post-8896675)
 * What you could do is keep both forms, but make sure the field names are the same
   for each (even though the display name for the field is in a different language).
   Then you can pull results from both forms in any shortcode or export using `form
   ="form1,form2"` (name of your forms).
 * Or, using the link you cited above, you could add a filter on one of the forms
   and save it to the other form. (Again the form field names would need to be the
   same).
 *     ```
       function myFilter($formData) {
          if ($formData->title == 'form2 name') {
             $formData->title = 'form1 name';
          }
           return $formData; 
       }
       ```
   
 * If the form field names were not the same, then you could add additional code
   to change them each form2 field name to a name in form1.
 * add_filter(‘cfdb_form_data’, ‘myFilter’);
 *  Thread Starter [rconnard](https://wordpress.org/support/users/rconnard/)
 * (@rconnard)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/two-forms-one-database/#post-8900294)
 * Michael, thank you again. I’m marking this as resolved because your first suggestion
   solved my problem.
 * However, I’m curious about the filter and I’ve tried to put it together but something’s
   not quite working. I’ve uploaded this screenshot for you. Is there something 
   that I’ve done wrong?
 * [http://thepicnicwedding.com/images/cfdb_filter_screenshot.png](http://thepicnicwedding.com/images/cfdb_filter_screenshot.png)
 * Thanks!
 *  Plugin Author [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * (@msimpson)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/two-forms-one-database/#post-8905647)
 * You having registered the function to be called by anything. Forgot this line
   at the end:
 * `add_filter('cfdb_form_data', 'myFilter');`

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Two Forms 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

 * [cfdb](https://wordpress.org/support/topic-tag/cfdb/)
 * [database](https://wordpress.org/support/topic-tag/database/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Simpson](https://wordpress.org/support/users/msimpson/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/two-forms-one-database/#post-8905647)
 * Status: resolved