I got the problem solution myself. See the code below this will do that.
Put the code inside your newly created custom template.
<?php
if (!empty($_POST)) {
global $wpdb;
$table = wp_achord;
$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
}
?>
Related Posts:
- Insert data in database using form
- Connect forms in WP to external database
- Inserting data into custom tables
- Storing textbox values in Database
- Store and Encrypt Contact Form 7 Submissions in Database? [closed]
- Form Data not getting stored in WordPress database
- Sending data with multi step form to wp database
- Retrieve data from the database to table such as comments in the admin control panel
- WordPress running SQL query to update database from form
- Form that sends data to an admin panel and can export it
- Insert Query not working in the form
- Using $wpdb | checking entered email against existing emails in db
- Storing user submitted forms [closed]
- Getting value from database table depending on field value
- Whats the best practise on how to store json data from a custom settings page?
- How to edit custom table data in frontend
- User input to database
- Creating a custom form with ability to query and submit to SQL
- Change user_nickname for author page link
- Insert variables into wpdb in custom post template
- Getting values from form and saving in database but spaces are inserted instead of form values
- Help posting values to DB on submit using $wpdb->query
- Select data from foreach loop and send it to wordpress database
- insert data from a form:: Warning Empty query mysqli::query()
- Form display in new page
- $wpdb not working
- Auto populate form fields based on serial input or pull listings from other websites?
- Simple email input store in database
- User accounts for saving form data?
- Insert Extra fields added in the front end registration form to DB
- Creating Job Tickets
- Saving data to database and exporting to excel
- wp_usermeta key problem
- Is it possible to have a form page for logged-out users where values are stored persistently?
- Is it fine to have foreign key as primary key?
- delete_option() and update_option() returning false
- How to change option recently_edited?
- How to initialize $wpdb?
- Organizing WP Pages based on old website database
- When importing database, it shows error
- How to close wpdb connection? [duplicate]
- Why is Woocommerce writing in my wp_comment table?
- Error establishing a database connection when migrating site to localhost
- How to implement content from external database into WordPress text page? [closed]
- Strange characters on wordpress site – Not UTF8 Issue
- WordPress showing install screen after max_questions error
- Connect to live db whilst working locally
- WooCommerce – Query for ordered products
- How does WordPress store data?
- Query WordPress database by registered date and role
- Tons of Twitter rows in my database
- Why can’t I swap a DB in a WP install? [closed]
- How to replace values in WordPress DB using phpMyAdmin
- How do I reset a self-hosted WordPress URL?
- Show content from database
- Customize JSON output
- CRUD operations using WordPress database API
- Adding Custom Forms
- Display SQL that wordpress is running
- change wp user status from wp_users table
- How to resolve Connections using insecure transport are prohibited while –require_secure_transport=ON
- Difficulty importing my live site to local
- WordPress returns to an old version
- data (html) migration to posts
- Super slow queries from author archive pages killing my database
- localize elements in database
- Get value form wordpress database
- Moving to another server database connection error [closed]
- Best practice to limit results in get_row()?
- Is there an easy way of exporting posts with their category already asigned and pictures from localhost?
- Connect to another WP install and grab post based on custom field
- Which table (and column) has the content of configured get_post_meta?
- Serialize data before inserting into the DB
- Pages from custom table
- content disappearing minutes after it’s published
- What is the most efficient way to reset a WordPress site?
- Optimizing function that automatically creates internal links based on post title string
- Can I customised default WP table
- Woocommerce – Check product stock availability from external database
- WordPress where clauses in db select
- How to display data from db in select list [closed]
- Will adding & modifying default WordPress table index break future WordPress update
- echo site_url() returns a different value than what is in the database siteurl field
- Native timestamp on wp_options option
- _wp_attachment_metadata is not being added to database when PDF files uploaded
- SELECT rows between two datetimes when the range is dynamic [closed]
- How to get the full stack trace for WordPress “table doesn’t exist” error in debug.log?
- error establishing a database connection 3
- How to edit posts/pages without making the change live?
- Correct and secure way to access a custom SQL database in a custom PHP template file
- Does WordPress Support Using Named Pipes on the Windows Operating System?
- Missing latest posts and options after DB migration via phpMyAdmin
- Custom metabox does not store data
- wordpress database error
- How do i get value from wp_postmeta?
- Local host to server import problem
- Display single post inside accordion based on form submission results
- featured image not showing up with mysql_connect
- Options of accessing wordpress data from mobile app
- WP Multisite Users Not Linking