title: How to update html repeated field values to mysql database
body: <p>I have a html repeated values in array that i need to update to database, i need a help on how to use php script to update to database where staffid mataches . See below my HTML code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;head lang="en"&gt;
    &lt;meta chartaxt="UTF-8"&gt;
    &lt;link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"&gt;
    &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="bootstrap/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;title&gt;Sample salary computation&lt;/title&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
    &lt;form method="POST" name="regis" id="regis"&gt;
      &lt;table align="center" border="1" width="200"&gt;
        &lt;tr&gt;
          &lt;th&gt;Staff ID&lt;/th&gt;
          &lt;th&gt;Salary&lt;/th&gt;
          &lt;th&gt;Total Tax&lt;/th&gt;
          &lt;th&gt;Total Net Pay&lt;/th&gt;
  
  
        &lt;/tr&gt;
  
        &lt;!--Staff 1--&gt;
        &lt;tr data-id="STAFF/2016/001"&gt;
          &lt;td&gt;
            &lt;input type="text" name="staffid[]" class="staffid" value="STAFF/2016/001" readonly="readonly"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" name="salary[]" class="salary" placeholder="salary" value="5000"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" name="tax[]" class="tax" placeholder="tax" value="500"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" name="total[]" class="total" placeholder="total" readonly="readonly" value="4500"&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;!--Staff 2--&gt;
  
        &lt;tr data-id="STAFF/2016/002"&gt;
          &lt;td&gt;
            &lt;input type="text" name="staffid[]" class="staffid" value="STAFF/2016/002" readonly="readonly"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input name="salary[]" class="salary" type="text" placeholder="salary" value="10000"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" placeholder="tax" name="tax[]" class="tax" value="1000"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" placeholder="total" class="total" name="total[]" readonly="readonly" value="9000"&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;!--Staff 3--&gt;
  
        &lt;tr data-id="STAFF/2016/003"&gt;
          &lt;td&gt;
            &lt;input type="text" name="staffid[]" class="staffid" value="STAFF/2016/003" readonly="readonly"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input name="salary[]" class="salary" type="text" placeholder="salary" value="8400"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" placeholder="tax" name="tax[]" class="tax" value="400"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            &lt;input type="text" placeholder="total" class="total" name="total[]" readonly="readonly" value="800"&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
  
        &lt;tr&gt;
          &lt;td width="300"&gt;
  
            &lt;input type="button" name="update" value="Update Values" class="btn btn-danger"&gt;
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Kindly assist. I want the SQL update query to look like </p>
  
  <pre><code>"Update payroll SET salary ='".$_POST['salary']."', tax='".$_POST['tax']."', total ='".$_POST['total']."' WHERE staffid= '".$_POST['staffid']."'"
  </code></pre>