title: Insert data into Wordpress database table from a custom form
body: <p>I am trying to insert data into Wordpress database by creating a table. I have created the table but when I try to insert the data from form, it does not insert the data. I have checked that database connection works, but the insertion does not happen. Can someone help me on this? Here is my code:-</p>
  
  <pre><code>&lt;?php
      require_once('/wp-config.php');
      global $wpdb;
  
      if(isset($_POST['submit'])){
          $wpdb-&gt;insert( 'wp_post_job', array( 'organizationname' =&gt;
          $_POST['organizationname'], 'post' =&gt; $_POST['post'], 'publishfrom' =&gt;
          $_POST['publishfrom'], 'publishupto' =&gt; $_POST['publishupto'],
          'qualification1' =&gt; $_POST['qualification1'], 'qualification2' =&gt;
          $_POST['qualification2'], 'qualification3' =&gt; $_POST['qualification3'],
         'qualification4' =&gt; $_POST['qualification4'], 'experience1' =&gt;
          $_POST['experience1'], 'experience2' =&gt; $_POST['experience2'],
         'experience3' =&gt; $_POST['experience3'], 'training1' =&gt; $_POST['training1'], 'training2' =&gt; $_POST['training2'], 'training3' =&gt; $_POST['training3'],
         'training4' =&gt; $_POST['training4'], 'training5' =&gt; $_POST['training5'] ),
          array( '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s', '$s' ) );
      }
  ?&gt;
  
  &lt;?php
  /*
  Template Name: Form
  */
  ?&gt;
  &lt;?php global $pc_theme_object; /* Reference theme framework class */ ?&gt;
  &lt;?php get_header(); ?&gt;
  
  &lt;form action="" id="postjob" method="post"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="organizationname"&gt;Organization Name:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="organizationname" id="organizationname" value="/&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="post"&gt;Post:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="post" id="post" value="" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="publishfrom"&gt;Publish From:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="publishfrom" id="publishfrom" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="publishupto"&gt;Publish Upto:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="publishupto" id="publishupto" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="qualification"&gt;Qualification:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="qualification1" id="qualification1" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="qualification2" id="qualification2" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="qualification3" id="qualification3" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="qualification4" id="qualification4" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="experience"&gt;Experience:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="experience1" id="experience1"/&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="experience2" id="experience2"/&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="experience3" id="experience3"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;label for="training"&gt;Training:&lt;/label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="training1" id="training1" /&gt;&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="training2" id="training2" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="training3" id="training3" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="training4" id="training4" /&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="training5" id="training5" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;button type="submit" name="submit"&gt;Submit&lt;/button&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;?php get_footer(); ?&gt;
  </code></pre>