title: insert output from mysql query into html table one after another
body: <p>heloo, i want to serarch particular row from mysql database and same should be displayed on html table. I have tried the below code but it only gives the single row which is result of current query, previous row get overwritten. I am fetching a row for particular id,next time when i give another id,another row should be fetched and it should be added to the table next to previous one..</p>
  
  <pre><code>     &lt;html&gt;
      &lt;body&gt;
      &lt;form action="&lt;?php $_PHP_SELF ?&gt;" method="POST"&gt;
      &lt;tr&gt;
      ProductID: &lt;input type="number" name="ProductID"&gt;
      &lt;input type="submit" value ="Go"&gt; 
     &lt;/form&gt;
     &lt;/tr&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  
  
   &lt;?php
  
     $con=mysqli_connect("localhost","root","m70830807","Inventory");
  // Check connection
  if (!$con)
   {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    mysqli_select_db("Inventory",$con);
   $ID=$_POST['ProductID'];
   //echo $ID;
   $result = mysqli_query($con,"SELECT ProductID, ProductName, UnitPrice FROm  Products_Sold where ProductID =" .$ID);
  
  echo"&lt;table border = '1'&gt;
  &lt;tr&gt;
  &lt;th&gt;ProductID&lt;/th&gt;
  &lt;th&gt;ProductName&lt;/th&gt;
  &lt;th&gt;UnitPrice&lt;/th&gt;
  &lt;/tr&gt; ";
  //$row=mysqli_fetch_array($result);
   //$c1= $row['ProductID'];
   //$c2=$row['ProductName'];
    //$c3=$row['UnitPrice'];
    //echo $c1; 
   //echo $c2;
   //echo $c3;
  
      //$ins= mysqli_query($con,"insert into Temp (ProductID,ProductName,UnitPrice) values ('%d','%s','%f')", $c1,$c2,$c3);
  
     //$fetch=mysqli_query($con,"select ProductId,ProductName,UnitPrice from  Temp");
        while( $row = mysqli_fetch_array($result))
       { echo "&lt;tr&gt;";
       echo "&lt;td&gt;". $row['ProductID'] . "&lt;/td&gt;";
       echo  "&lt;td&gt;" . $row['ProductName'] ." &lt;/td&gt;";
       echo   "&lt;td&gt;" . $row['UnitPrice'] . "&lt;/td&gt;";
       echo "&lt;/tr&gt; ";
  
       }
       echo "&lt;/table&gt;";
  
        mysqli_close($con);
  
  
        ?&gt; 
  </code></pre>