Start your code here
add_action('frm_after_create_entry', 'copy_into_my_table', 20, 2); function copy_into_my_table($entry_id, $form_id){ if($form_id == 4){ //change 4 to the form id of the form to copy global $wpdb; $values = array('col_name1' => $_POST['item_meta'][25], 'col_name2' => $_POST['item_meta'][26]); //replace 25 and 26 with the field ids of the Formidable form. Change col_name to the column names in your table $wpdb->insert('table_name', $values); } }
Source:https://formidableforms.com/knowledgebase/frm_after_create_entry/#kb-insert-form-data-into-second-database-table Finally, I must say that this plugin is a wonderful plugin for complex and enterprise needs BR
create view lp_match_pivot as
select
wp_frm_items.id AS match_id,
(
case
when (
wp_frm_item_metas.field_id = 349
) then wp_frm_item_metas.meta_value
end
) AS man_user_id,
(
case
when (
wp_frm_item_metas.field_id = 330
) then wp_frm_item_metas.meta_value
end
) AS man_status,
(
case
when (
wp_frm_item_metas.field_id = 333
) then wp_frm_item_metas.meta_value
end
) AS man_status_date,
(
case
when (
wp_frm_item_metas.field_id = 350
) then wp_frm_item_metas.meta_value
end
) AS woman_user_id,
(
case
when (
wp_frm_item_metas.field_id = 332
) then wp_frm_item_metas.meta_value
end
) AS woman_status,
(
case
when (
wp_frm_item_metas.field_id = 334
) then wp_frm_item_metas.meta_value
end
) AS woman_status_date
from
wp_frm_item_metas
join wp_frm_items on (
wp_frm_item_metas.item_id = wp_frm_items.id
)
and (
wp_frm_items.form_id = 38
)
where
(wp_frm_items.is_draft = 0)
and (
wp_frm_item_metas.field_id in (349, 330, 333, 350, 332, 334)
)
create view lp_match as
select
lp_match_pivot.match_id AS match_id,
max(lp_match_pivot.man_user_id) AS man_user_id,
max(lp_match_pivot.man_status) AS man_status,
max(lp_match_pivot.man_status_date) AS man_status_date,
max(lp_match_pivot.woman_user_id) AS woman_user_id,
max(lp_match_pivot.woman_status) AS woman_status,
max(lp_match_pivot.woman_status_date) AS woman_status_date
from
local.lp_match_pivot
group by
lp_match_pivot.match_id
Thanks Nikcs
Please login or Register to submit your answer