title: Submitting one out of many inputs on a page to mysql database using wordpress
body: <p>At current I managed to get a form on a wordpress page to submit data to a mysql database (a very large victory for me; not big into php/coding)</p>
  
  <p>This is the code I have been using, but need help changing:</p>
  
  <pre><code>&lt;form method="post"&gt;
  Value1: &lt;input type="text" name="field1" /&gt;
  Value2: &lt;input type="text" name="field2" /&gt;
  Value3: &lt;input type="text" name="field3" /&gt;
  Value4: &lt;input type="text" name="field4" /&gt;
  Value5: &lt;input type="text" name="field5" /&gt;
  &lt;input type="submit" /&gt;&lt;/form&gt;
  
  
  $newdb = new wpdb( 'username', 'password', 'database', 'localhost' );
  
  $field1 = $_POST['field1'];
  $field2 = $_POST['field2'];
  $field3 = $_POST['field3'];
  $field4 = $_POST['field4'];
  $field5 = $_POST['field5'];
  
  $newdb-&gt;insert("test", array(
  "field1" =&gt; $field1,
  "field2" =&gt; $field2,
  "field3" =&gt; $field3,
  "field4" =&gt; $field4,
  "field5" =&gt; $field5
     ));
  </code></pre>
  
  <p>As you can see, this causes all the inputs on the page to be submitted, and ends up creating blank cells in my table rows when there is no data inserted into the fields.</p>
  
  <p><strong>I need to be able to submit each input <em>separately</em></strong>, hopefully without creating a seperate php script for each input, and without entering blank cells in my table.</p>