title: Submit button to insert HTML table row into DB table row
body: <p>Does anyone know how I should design a query to insert a row of a HTML table, the content of which is from a table in my db, into another table in my db? I am struggling with relating the submit button to individual result rows.</p>
  
  <p>html - </p>
  
  <pre><code> &lt;form id="order" name="form1" method="post" action="script/addOrder.php"&gt;
      &lt;h3&gt;&lt;a id="curry"&gt;Curry Dishes:&lt;/a&gt;&lt;/h3&gt;&lt;img src="img/curry.jpg" &gt;
          &lt;table class="menu"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Dish Name&lt;/th&gt;
                      &lt;th&gt;Description&lt;/th&gt;
                      &lt;th&gt;Allergy Information&lt;/th&gt;
                      &lt;th&gt;Price&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
          &lt;tbody&gt;
      &lt;?php
              include "script/dbconn.php";
  
                  $sql="SELECT `dish`.`dishName`, `category`.`categoryName`, `allergy`.`allergyName`, `dish`.`dishPrice`, `dish`.`dishDescription` FROM `dish` 
                  INNER JOIN category ON dish.categoryID = category.categoryID
                  INNER JOIN allergy ON dish.allergyID = allergy.allergyID
                  WHERE `categoryName` LIKE 'Curry'
                  ORDER BY dishName ASC";
                  //-run  the query against the mysql query function
                  $result=mysqli_query($conn, $sql);
                  //-create  while loop and loop through result set
                  while($row=mysqli_fetch_array($result)){
                      $Name=$row['dishName'];
                      $Desc=$row['dishDescription'];
                      $Price=$row['dishPrice'];
                      $Allergy=$row['allergyName'];
  
                      //-display the result of the array?&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;?php echo $Name;?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $Desc;?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $Allergy;?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $Price;?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input type="submit" id="submit" name="submit" value="Order"&lt;/td&gt;
                      &lt;/tr&gt;
              &lt;?php }
      ?&gt;
  </code></pre>