title: PHP changing individual table cell values
body: <p>I'm making a web application using PHP. I'm generating a table with a SQL database. What I need to do is change the value of individual cells when I click on the button next to the cell. The values I put in the textbox need to be sent to the database. The problem is that when I press a button every value gets sent in stead of the individual one. I'm giving each textbox an individual id.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;table id="Aanbodstabel"&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th width = 8%&gt;Fustcode&lt;/th&gt;
              &lt;th width = 8%&gt;Cultivar&lt;/th&gt;
              &lt;th width = 8%&gt;Fust&lt;/th&gt;
              &lt;th width = 8%&gt;Aantal p. Fust&lt;/th&gt;
              &lt;th width = 8%&gt;Aanbod&lt;/th&gt;
              &lt;th width = 2%&gt;Bestellen&lt;/th&gt;
              &lt;th width = 8%&gt;AantalBesteld&lt;/th&gt;
              &lt;th width = 10%&gt;&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;?php
          $AanbodsTabel = (BestellingDB::getInstance()-&gt;get_aanbod_per_datum_per_gebruikersid($GebruikersID));
  
          while ($row = mysqli_fetch_array($AanbodsTabel)){
              echo "&lt;tr&gt;&lt;td width = 6%&gt;Fustcode&lt;/td&gt;";
              echo "&lt;td width = 6%&gt;" . htmlentities($row['cultivar']) . "&lt;/td&gt;";
              echo "&lt;td width = 6%&gt;" . htmlentities($row['AantalFust']) . "&lt;/td&gt;";
              echo "&lt;td width = 6%&gt;" . htmlentities($row['AantalPerFust']) . "&lt;/td&gt;";
              echo "&lt;td width = 6%&gt;" . htmlentities($row['AantalStelen']) . "&lt;/td&gt;";
              echo "&lt;td width = 4%&gt;&lt;input type ='text' id='Bestelbox' value='' name='AantalBestellen " . htmlentities($row['aanbodid']) . "' &lt;/td&gt;";
              echo "&lt;td width = 6%&gt;" . htmlentities($row['AantalFust']) . "&lt;/td&gt;";
              echo "&lt;td width = 8%&gt;&lt;input type='submit' value='Bestellen' name='btnBestellen' class='btnBestel'/&gt;&lt;/td&gt;&lt;/tr&gt;";
          }
          mysqli_free_result($AanbodsTabel);
          ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;/form&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>If any other code is needed I'm  happy to post it.</p>