title: Insert custom field input data from user into $wpdb in wordpress without using plugin?
body: <p>I have a website in word press i have added the following HTML custom field on the front page in WordPress ,Here i am taking input data from user and i have to insert that input data into my WordPress database without using any plugin.The problem is that i am not able to insert data in data base table.All the code(HTML+php) is in front-page.php file.
  Here is my HTML code</p>
  <pre><code> &lt;form method=&quot;post&quot; action=&quot;&quot;&gt;
  
   &lt;div style=&quot;text-align:left; border: 1px solid #bbb; padding:10px;&quot;&gt;
      &lt;div&gt;
          &lt;label for=&quot;name&quot;&gt;name&lt;/label&gt;
          &lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; /&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;label for=&quot;email&quot;&gt;email&lt;/label&gt;
          &lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; /&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;label for=&quot;message&quot;&gt;message&lt;/label&gt;
          &lt;textarea name=&quot;message&quot; id=&quot;message&quot; style=&quot;width:250px; height:100px&quot;&gt;&lt;/textarea&gt;
      &lt;/div&gt;
      &lt;input type=&quot;submit&quot; name=&quot;signup&quot; value=&quot;signup&quot; /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  <p>Here is my WordPress php code</p>
  <pre><code> &lt;?php wp_reset_query();
      $wpdb-&gt;insert(
      $tbl_custom,
      array(
  
  
      &quot;name&quot; =&gt; $name,
  &quot;email&quot; =&gt; $email,
  &quot;mesage&quot; =&gt; $massege,
          
      )
      );
    $Offerid=$wpdb-&gt;insert_id;
     //var_dump( $wpdb-&gt;last_query );
      ?&gt;
  </code></pre>
  <p>Below is table structure</p>
  <h2>Table structure for table <code>custom</code></h2>
  <pre><code>CREATE TABLE `custom` (
    `name` varchar(20) NOT NULL,
    `email` varchar(20) NOT NULL,
    `message` varchar(20) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  </code></pre>
  <p>Below is the screenshot</p>
  <p><img src="https://i.stack.imgur.com/CQeuN.jpg" alt="enter image description here" /></p>