title: How to handle unknown number of items from a form in php
body: <p>Working on making an inventory page for work. I have written a page that will loop through my data base and display all of the items in there.</p>
  
  <pre><code>include 'auth.php'; //to change login, please authenticate 
  $sql="SELECT * FROM `inventory` ORDER BY `id` asc;";
  $result=mysql_query($sql);
  while($rows = mysql_fetch_array($result)){
  echo    $rows["name"];
  &lt;input type="text" name="&lt;? echo $rows["id"];  ?&gt;" id="&lt;? echo $rows["id"] ?&gt;" placeholder="Who will go in here?" /&gt;
  }
  </code></pre>
  
  <p>The above code is doing what I want. I would like to put this in a form and have a submit button. Let's say the form is</p>
  
  <pre><code>&lt;form method="POST" action="page.php"&gt;
  </code></pre>
  
  <p>Now I want to be able to write a page.php so that it can handle all of the data regardless of the number of items. In the past I have done the following</p>
  
  <pre><code>$fname=$_POST['fname'];
  $lname=$_POST['lname'];
  $phone=$_POST['phonenum'];
  $email = $_POST['email'];
  $age = $_POST['b18'];
  </code></pre>
  
  <p>But that won't work as I will have an unknown amount of post. Please write any code you like. I prefer document pages. </p>