Home › Forums › Quform WordPress › update into custom database
This topic is: resolved
- This topic has 2 replies, 2 voices, and was last updated 7 years, 9 months ago by
kunstbada.
Viewing 3 posts - 1 through 3 (of 3 total)
- AuthorPosts
- December 1, 2017 at 1:57 pm #23286
kunstbada
ParticipantHello,
I’d like make a form which can update custom database table from Quform if you add new text.
It seems like this manual but it doesn’t work in my case.I want to share the first name from wp current user name with quform.
Here is my code.
Can you tell me what should I do? What is wrong about this code?Best regards
Yoon
function my_load_form_data(iPhorm $form) { if (!isset($_GET['edit'])) { return; } global $wpdb; $rowId = absint($_GET['edit']); $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM hddt_usermeta WHERE id = %d', $rowId), ARRAY_A); if (!is_array($row)) { return; } // The form values to set $data = array( '1_20' => $row['first_name'], /* 'iphorm_1_2' => $row['email'], 'iphorm_1_3' => $row['phone'], 'iphorm_1_4' => maybe_unserialize($row['checkbox']),*/ '1_22' => $rowId ); $form->setValues($data); } add_action('iphorm_pre_display_1', 'my_load_form_data');
- This topic was modified 7 years, 9 months ago by
kunstbada.
- This topic was modified 7 years, 9 months ago by
kunstbada.
- This topic was modified 7 years, 9 months ago by
kunstbada.
Attachments:
You must be logged in to view attached files.December 7, 2017 at 11:31 am #23359Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
December 8, 2017 at 7:04 am #23388kunstbada
ParticipantThank you very much.
It’s working well. 🙂 - This topic was modified 7 years, 9 months ago by
- AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.