trying to update quantity change in a form php
<p>please i am trying to make an update in a database where changes have been made to quantity,but i need a guide where the change is update is only made to where the change is done.</p>

<p>this is the code where the changes would be done</p>

<pre><code>&lt;?
    $pplresult = mysql_query("SELECT * FROM repplac");
    echo "&lt;table border='1'&gt;&lt;tr&gt;&lt;th&gt; SHOP NAME&lt;/th&gt;&lt;th&gt; PRODUCT NAME&lt;/th&gt;&lt;th&gt;
    PRODUCT SIZE&lt;/th&gt;&lt;th&gt; PRODUCT COLOUR&lt;/th&gt;&lt;th&gt; PRODUCT QUANTITY&lt;/th&gt;&lt;th&gt;
    PRICE&lt;/th&gt;&lt;th&gt; &lt;/th&gt;&lt;/tr&gt;";
    while($row = mysql_fetch_assoc($pplresult)){?&gt;
&lt;form action='updatepplac.php' method='Post' class='slistbar'&gt;
&lt;?echo "&lt;tr&gt;&lt;td&gt;" .$row['Sname'] ."&lt;/td&gt;&lt;td&gt;" .$row['Pname'] ."&lt;/td&gt;&lt;td&gt;" .$row['Psize'] ."&lt;/td&gt;&lt;td&gt;" .$row['Pcolour'] ."&lt;/td&gt;&lt;td&gt;" ."&lt;input type='text' name='Pquantity' id='Pquantity' value='{$row['Pquantity']}' &gt;" ."&lt;/td&gt;&lt;td&gt;" .$row['Price'] ."&lt;/td&gt;&lt;td&gt;" ?&gt;
&lt;a href="deleteproduct.php?del=&lt;?php echo $row['Pidno'];?&gt;"&gt;delete&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;?php }
// table closing tag
?&gt;
</code></pre>

<p>and the update script</p>

<pre><code>$submit = $_POST['submit'];
        $pid = $_GET['del'];
        $nPquantity = $_POST['Pquantity'];
        //echo "$nPquantity";

        //die();
        if('POST' === $_SERVER['REQUEST_METHOD'])
        {
        $queryreg = mysql_query("
        UPDATE repplac SET Pquantity='$nPquantity' ")or die(mysql_error());
        } 
</code></pre>
