0
  • I am very new to WordPress, and today is my 1st day on WordPress. I have a requirement which is very normal for any developer on their platforms, but for me it's challenging
  • In my WordPress site I would like to create forms & tables and save information into the table.

Can anyone please help me in achieving this task?

2

3 Answers 3

0

Since you are a first timer (Welcome to the Wordpress World, by the way) an easy way to achieve that is using plugins.

For forms, I recommend Contact Form 7 (https://wordpress.org/plugins/contact-form-7/). It will allows you to create almost any type of form.

To record the data into database and display as table, you can use the Contact Form DB plugin (https://wordpress.org/plugins/contact-form-7-to-database-extension/) that get all data from CF7 forms and record into database. You will be able to see those records inside wp-admin.

Hope it helps. :)

0

You will probably receive as many plugin recommendations as the number of WordPress users that you ask.

For forms I personally use Gravity Forms, a commercial(paid ~ $40/yr) plugin. A similar option is Ninja Forms, free for basic capability and paid upgrades for added capabilities.

For generating tables in a WordPress page or post I recommend the TablePress plugin, available from the wordpress.org plugin repository.

Look at all of the options and determine if the plugin will accomplish the functions that you need for that particular capability before you install it. Do not install and activate multiple plugins that accomplish the same thing - such as Contact Form 7 and Gravity Forms - they will probability interfere with each other.

Have a great time learning!

0

First you create table of your required form field in database than Put the code inside your newly created custom template.

<?php
        if (!empty($_POST)) {
        global $wpdb;
            $table = table_name;
            $data = array(
                'name' => $_POST['yourname'],
                'chord'    => $_POST['chord']
            );
            $format = array(
                '%s',
                '%s'
            );
            $success=$wpdb->insert( $table, $data, $format );
            if($success){
            echo 'data has been save' ; 
}
}
else   {
?>
        <form method="post">
        <input type="text" name="yourname">
        <textarea name="chord"></textarea>
        <input type="submit">
        </form>

       <?php }  ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.