title: Update all rows in MySql in while loop PHP
body: <p>I have a problem. I want to update values in MySql with a while loop.
  My code so far:
  Here I get the rows from the database:</p>
  
  <pre><code>$sql = mysql_query("SELECT * FROM Price WHERE idCar='$idCar'");
  while($row = mysql_fetch_array($sql)){
  $i = $i+1;
  $price = $row["price"];
  $newdate= $row["newdate"];
  $idCar = $row["idCar"];
  $idPrice = $row["idPrice"];
  $sqlsearch .= '  &lt;tr&gt;
      &lt;td height="31" align="left" valign="middle"&gt;&lt;div align="right"&gt;Dato:&lt;/div&gt;&lt;/td&gt;
      &lt;td height="31" align="left" valign="middle"&gt;
      &lt;fieldset id="example_1"&gt;&lt;input type="text" name="newdate" class="field" cols="42" rows="8" id="datepicker'. $i .'" value='. $newdate.' /&gt; 
      &amp;emsp;&amp;emsp;Pris:&amp;nbsp;&lt;input type="text" name="price" class="field" cols="42" rows="8" id="price" value='. $price .' /&gt;&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;
      Priceid:&amp;nbsp;&lt;input type="text" name="idPrice" class="field" cols="42" rows="8" id="idPrice" value='. $idPrice .' /&gt;
      &lt;/fieldset&gt;&lt;/td&gt;
      &lt;/tr&gt;';
  </code></pre>
  
  <p>Here I want to update the new values:</p>
  
  <pre><code>$idCar = $_GET['idCar'];
  
  $sqlupdate = mysql_query("UPDATE Price SET newdate='$newdate', price='$price' WHERE idPrice='".$idPrice."'");
  
  while($row = mysql_query($sqlupdate)){
      $price = $row["price"];
      $newdate = $row["newdate"];
      $idPrice = $row["idPrice"];
      }
  </code></pre>