Want to insert data into WordPress database table from a custom form? Use the below WordPress code in your theme’s or plugin’s file to insert data into WordPress database.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | if ( isset( $_POST['submit'] ) ){ global $wpdb; $tablename = $wpdb->prefix.'post_job'; $wpdb->insert( $tablename, array( 'organizationname' => $_POST['organizationname'], 'post' => $_POST['post'], 'publishfrom' => $_POST['publishfrom'], 'publishupto' => $_POST['publishupto'], 'qualification1' => $_POST['qualification1'], 'qualification2' => $_POST['qualification2'], 'qualification3' => $_POST['qualification3'], 'qualification4' => $_POST['qualification4'], 'experience1' => $_POST['experience1'], 'experience2' => $_POST['experience2'], 'experience3' => $_POST['experience3'], 'training1' => $_POST['training1'], 'training2' => $_POST['training2'], 'training3' => $_POST['training3'], 'training4' => $_POST['training4'], 'training5' => $_POST['training5'] ), array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.