I am trying to insert some values inside the wp database from the form but it’s not getting inserted. your help would be appreciated very much.
<form method="post" action="">
Name: <input type="text" name="name" id="name" />
Email: <input type="text" name="email" id="email"/>
<input type="submit" name="submit"/>
</form>
<?php
global $wpdb;
$name = $_POST['name'];
$email = $_POST['email'];
$table_name = $wpdb->prefix . "user2";
$wpdb->insert( $table_name, array(
'name' => $name,
'email' => $email ) ); ?>
You can insert using this code :
OR You can try core php