I am trying to insert data in Mysql into a table name wp_stuff. Wordpress didn't show me any error but the data is not being inserted. Where is the error of following code?
<form method="post"> //I also used here action attribute.
Stuff Name:<input type="text" name="name" id="name"><br><br>
....... so on....
<input type="submit" value="Submit Data">
</form>
<?php
if(isset($_POST['submit'])){
global $wpdb;
$name = $_POST['name'];
$f_name = $_POST['f_name'];
...... so on.....
$user_details = array('name' => $name, 'f_name' => $f_name, 'm_name' => $m_name, 'b_date' => $b_date, 'gender' => $gender, 'b_group' => $b_group, 'photo' => $photo, 'email' => $email, 'phone' => $phone, 'present_address' => $present_address, 'permanent_address' => $permanent_address, 'nid' => $nid, 'exp' => $exp, 'at' => $at, 'other_file' => $other_file, 'al' => $al, 'u_name' => $u_name, 'password' => $password, 'd_name'=> $d_name, 'in_time' => $in_time, 'out_time' => $out_time, 'j_date' => $j_date, 'salary' => $salary);
$table_name =$wpdb->prefix."stuff";
$result = $wpdb->insert($table_name, $user_details, array('%s','%s','%s','%s','%s','%s','%b','%s','%s','%s','%s','%b','%b','%b','%b','%b','%s','%s','%s','%s','%s','%s','%i'));
};
?>