title: Create a submit form (wrap the table into a form and show it as a table again) from the products that were ordered
body: <p><strong>EDIT:</strong> Maybe its easier to create a new column in the database. Named: to_order. 
  Then create an UPDATE Query for each product . Something like : UPDATE products SET to_order = '[VALUE_INPUT]' WHERE id = '[ID_PRODUCT]'
  The problem here is, where to excecute this query? How can I define the VALUE_INPUT and ID_PRODUCT for each row?</p>
  
  <p>If this works, and I can UPDATE each row for that specific product etc.
  I can easily create a mysqli_fetch_assoc again where only the [Product_name],[to_order] will be given.
  Please help.</p>
  
  <hr>
  
  <p>I'm working on a supplier order system. Where the manager of the restaurant can easily select a supplier, fill in how much stock he has now of that specific product. And it will automatically calculate how much you need to order.</p>
  
  <p>This part is done.But now, once we fill in the form I want to get an overview of all products you need to order, and it needs to be printable.</p>
  
  <p>For example in words explained:</p>
  
  <ul>
  <li><p>We have some columns in our table [ID_product][ID_supplier][Product_name][Stock][Minimum][To_order]</p></li>
  <li><p>ID_product, ID_supplier, Product_name and Minimum are all data from the database. Stock is what you need to fill in. And To_order is calculated by : Minimum-stock = To_order. (logic)</p></li>
  <li><p>With a mysql_fetch_assoc command we can show all specific products with its specific id and minimum integer.</p></li>
  <li><p><strong><em>Now here is the part where my question is:</em></strong> Once everything is filled in, you need to click a button that refers to a next page. On this page your total input is shown, a full list. 
  Like: [Product_name][To_order] </p></li>
  </ul>
  
  <p>So on this page you get an overview of your form where you filled in all these values. So you get a list (how big depends on how much products you have in your database) with all the calculated inputs from 'To_order'. </p>
  
  <p>My problem is, if I create a Form Action into my fetch_assoc, it can read all element names, but as soon you submit the form and go to the next page. All the data is lost.
  I need something where I can see the value from the previous page of that input. And then for all specific products.</p>
  
  <p>My <strong>form.php</strong> (Where I need to fill in my stock in order to calculate the 'To_order' input). This is working fine.</p>
  
  <pre><code>    &lt;table width="600" border="1" cellpadding"1" cellspacing= "1" class="flatTable"&gt;
                                  &lt;tr class="headingTr"&gt;
                                      &lt;th&gt;
                                          Supplier code
                                      &lt;/th&gt;
                                      &lt;th&gt;
                                          Product
                                      &lt;/th&gt;
                                          &lt;th&gt;
                                          Stock
                                      &lt;/th&gt;
  
                                          &lt;th&gt;
                                          Minimum
                                      &lt;/th&gt;
  
                                          &lt;th&gt;
                                          To order
                                      &lt;/th&gt;
                                  &lt;/tr&gt;
  
  
                                  &lt;?php
  
  
                                  while ($producten=mysqli_fetch_assoc($result_producten)) {
                                      echo "&lt;tr&gt;";
                                      echo "&lt;td&gt;&lt;form method='POST' action='lijst.php'&gt;&lt;label name='".$producten['lev_id']."'&gt;".$producten['lev_id']."&lt;/label&gt;&lt;/td&gt;";
                                      echo "&lt;td&gt;&lt;label name='".$producten['productnaam']."'&gt;".$producten['productnaam']."&lt;/label&gt;&lt;/td&gt;";
  
                                          echo "&lt;td&gt;
        &lt;input id='".$producten['minimum']."' name='".$producten['id']."' type='text' 
           oninput='calculateBestelling(this.value,this.name, this.id)' 
            onkeypress='return event.charCode &gt;= 48 &amp;&amp; event.charCode &lt;= 57'/&gt;
                    &lt;/td&gt;";
                                      echo "&lt;td&gt;&lt;input id='".$producten['minimum']."' name='mytext2'  type='text' readonly='true' value='".$producten['minimum']."' /&gt;&lt;/td&gt;";
  
                                      echo "&lt;td&gt;&lt;input id='".$producten['id']."' name='order[]' type='text' readonly='true'  /&gt;&lt;/td&gt;";
  
  
                                      echo "&lt;/tr&gt;";
  
  
  
                                  }
  
  
                                  ?&gt;
  
  &lt;script&gt;
  var minimum;
  var stock;
  var order;
  function calculateBestelling(val,name,id){
      minimum = document.getElementById(id).id;
      stock =  document.getElementById(id).value;
      document.getElementById(name).value = minimum - val;
      order = document.getElementById(name).value;
  
      if (order &lt; 0) {
  
  
      document.getElementById(name).value = '0';
     }
  
  }
  
  
  &lt;/script&gt;
                              &lt;/table&gt;
                                      &lt;p&gt;&lt;input type='submit'/&gt;&lt;/p&gt;&lt;/form&gt;
  </code></pre>
  
  <p>Then the next page (where the overview needs to be shown):</p>
  
  <pre><code>&lt;header&gt;
                          &lt;h2&gt;Complete order form - Supplier: (HERE THE SUPPLIER)&lt;/h2&gt;
  
                      &lt;/header&gt;
                      &lt;div class="container"&gt;
                          &lt;div class="row"&gt;
  
                              &lt;table width="600" border="1" cellpadding"1" cellspacing= "1" class="flatTable"&gt;
                                  &lt;tr class="headingTr"&gt;
                                      &lt;th&gt;
                                          Product
                                      &lt;/th&gt;
                                      &lt;th&gt;
                                          To order
                                      &lt;/th&gt;
  
                                  &lt;/tr&gt;
  
  
                                  &lt;?php
                              //And I dont know what I need to do here. I want the values from the 3rd input the previous file. But how I can combine this with each row for a specific product?
  
                                  while ($producten=mysqli_fetch_assoc($result_producten)) {
                                      echo "&lt;tr&gt;";
                                      echo "&lt;td&gt;PRODUCT HERE&lt;/td&gt;";
  
                                      echo "&lt;td&gt;&lt;input id='toorder' name='order[]' type='text' readonly='true' value='(THE VALUE OF THE PREVIOUS FILE FOR THAT PRODUCT)' /&gt;&lt;/td&gt;";
  
  
                                      echo "&lt;/tr&gt;";
  
  
                                  }
  
  
                                  ?&gt;
  
                              &lt;/table&gt;
  
  
  
                          &lt;/div&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>I created an image, where you simple can see what I have in my mind.
  URL TO IMAGE: <a href="http://i.stack.imgur.com/6AnTl.png" rel="nofollow">http://i.stack.imgur.com/6AnTl.png</a></p>
  
  <p>So we also need to check something like : if (!to_order > 0) { DONT SHOW ROW }</p>
  
  <p>Feel free to change codes, maybe some other way that works? Like staying on the same page, and hide the stock and minimum values. So we only can see the ID's, Product names and To_order values?</p>