title: Inserting data into DB column from an HTML table
body: <p>my question is, how could I insert data from a table with the click of a button into mysql DB?</p>
  
  <p>The table on my HTML is as follows:</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;th&gt;Name&lt;/th&gt;
      &lt;th&gt;Number&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;data&lt;/td&gt;
      &lt;td&gt;data&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The rows of course continue, depending on the data inserted.</p>
  
  <p>In my DB, the tables are as follows:</p>
  
  <pre><code>Person (ID, Name, Number)
  </code></pre>
  
  <p>The number table in the DB is blank, while the Name and ID tables are already filled up with data.</p>
  
  <p>I have a global variable where the number of total people is stored, which I think can come in handy</p>
  
  <pre><code>var totalPeople
  </code></pre>
  
  <p>As I mentioned before, I would like to make an ajax request and send the "Number" data from the HTML table into the Number column inside my DB, matching the name each person has (So, if for example, on my HTML table I have "David" with number 3 and "James" with number 5, I want the button to insert 3 into the David row in my DB and 5 into the James row).</p>
  
  <p>I thought of creating an array from the table and sending that array through ajax and making the SQL query, but I'm quite stuck as to how to do this...</p>
  
  <p>Thanks in advance</p>