title: Insert the input into mysql
body: <p>I am a newbie in programming. Excuse my ignorance.
  My english is not too good. Hope you understand what I mean in my question. </p>
  
  <p>How can I get the value of id <code>NILAI</code> below and insert into mysql. </p>
  
  <pre><code>     html += '&lt;tr&gt;';
                html += '&lt;td class="indi" align="center"&gt;';
                html += row.nis;
                html += '&lt;/td&gt;';
                html += '&lt;td class="indi"&gt;';
                html += row.nama_siswa;
                html += '&lt;/td&gt;';
                html += '&lt;td&gt;';
                html += '&lt;input id="nilai" type="text" placeholder="nilai"/&gt;';
                html += '&lt;/td&gt;';
                html += '&lt;/tr&gt;';  
  </code></pre>
  
  <p>I want the input value insert into mysql where col <code>nis</code> in mysql table same with row. nis</p>
  
  <p>I've been trying this, but It's wrong. It just read the value of the first row in input nilai and make a new nis=0.</p>
  
  <pre><code>var data1 = document.getElementById("nilai") ;
  var i;
      for (i=0;i&lt;data1.length;i++) {
         var sql='INSERT INTO nilaitugas(no_tugas, nilai) VALUES ("'+dataid+'","'data1.elements[i]. value+'")';
     } 
  </code></pre>
  
  <p>Note: dataid is a variabel from url that I need to input. </p>