title: mysql insert php while loop data in single row
body: <p>I have this code to select and output 2 rows (fixed) from database into html form with hidden input</p>
  
  <pre><code>&lt;?php
  $sql = ("SELECT * FROM `prices`");
  $query = mysql_query($sql);
      while ($rows = mysql_fetch_array($query)) { 
   ?&gt;
      &lt;form method="post" action="process/save.php"&gt;
      &lt;input type="hidden" value="&lt;?php echo $rows['Id']; ?&gt;" id="offerid" name="offerid[]" /&gt;
      &lt;input type="hidden" value="&lt;?php echo $rows['price']; ?&gt;" id="offerprice" name="offerprice" /&gt;
      &lt;input type="hidden" value="&lt;?php echo $rows['service']; ?&gt;" id="offerservice" name="offerservice" /&gt;
  
      &lt;?php }; ?&gt;     
      &lt;input type="email" value="" id="customeremail" name="customeremail" placeholder="Enter Your Email Address" /&gt;
      &lt;input type="submit" class="button" value="Save Prices" &gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and the <b>save.php</b> file is</p>
  
  <pre><code>&lt;?php include("database.php");
  $customeremail = mysql_real_escape_string($_POST['offerid']); 
  $offerprice = mysql_real_escape_string($_POST['offerprice']);
  $offerservice = mysql_real_escape_string($_POST['offerservice']);
  
  if(isset($_POST['submit'])){
  $sql="INSERT INTO Save_Quote(Email, Price1, Service1, Price2, Service2,) VALUES ('// what comes here')";
  $result="mysql_query($sql) or die (mysql_error())";
  }
  ?&gt;
  </code></pre>
  
  <p>how can i insert the values?</p>
  
  <p>Any help will be much appreciated, Thank You.</p>