G
G
greedy_wizard2020-05-15 01:11:42
WordPress
greedy_wizard, 2020-05-15 01:11:42

Need to write form data to Wordpress database?

How to write the data from the form and the data from the questionnaire into the Wordpress database,
you need to have a table with data about the person who passed the test and

try to add the test results

themselves in this way. load.php');
global $wpdb;
$table_name = $wpdb->prefix . "test_info";
$wpdb->insert( $table_name, array( 'name' => $_POST['name'],
'age' => $_POST['age'],
'sex' => $_POST['sex'],
'country' => $_POST['country'],
'city' => $_POST['city']));

covidtest.andygroove.com

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Orkhan Hasanli, 2020-05-15
@azerphoenix

Depending on how exactly you want to implement.
The simple solution is to
create an atomic record type.
Install the ACF plugin and add the required fields (name, age, sex, country, city) to the custom post type.
Then, using acf_form, submit the form and create a record in the database

D
Dima, 2020-05-15
Dolgoter @SpiderPigAndCat

you can use the contakt form 7 plugin to make forms and embed them and download the cf7database plugin and in the admin panel it will display all the data from the form
you can write to the options table in wp there is the possibility https://wp-kama.ru/function/get_option you can in the first column write the name and into another array with data and then take and iterate for output

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question