loop for update not working
<p>i am trying to update with a loop through $_post data,  but the update is not working</p>

<pre><code>require_once("include/session.php");
require_once("include/dataconnect.php"); 
require_once("include/functions.php"); 
if(array_key_exists('item', $_POST)){
    $items = $_POST['item'];
    //Loop through $_POST items, updating the database for each item
    foreach ($items as $item) { 
        $Pquantity = intval($item[0]);
        $Pidno = intval($item[1]);
        $queryreg = mysql_query("
            UPDATE repplac
                 SET Pquantity = {$Pquantity}
                 WHERE
                       Pidno = {$Pidno}
                 AND
                       username = '{$_SESSION['username']}'
        "); 
    }
</code></pre>

<p>this is the form that sends the data</p>

<pre><code> echo "
&lt;form action='updatepplac.php' method='Post' class='slistbar'&gt;
&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;";
</code></pre>

<p>// Get DB results and loop, outputting table rows with counter</p>

<pre><code>$pplresult = mysql_query("SELECT * FROM repplac") or die(mysql_error());
for ($i = 0; $row = mysql_fetch_assoc($pplresult); $i++) 
{
    echo "
      &lt;tr&gt;
        &lt;td&gt;".htmlspecialchars($row['Sname'])."&lt;/td&gt;
        &lt;td&gt;".htmlspecialchars($row['Pname'])."&lt;/td&gt;
        &lt;td&gt;".htmlspecialchars($row['Psize'])."&lt;/td&gt;
        &lt;td&gt;".htmlspecialchars($row['Pcolour'])."&lt;/td&gt;
        &lt;td&gt;
          &lt;input type='text' name='item[$i][Pquantity]' id='Pquantity' 
    value='".htmlspecialchars($row['Pquantity'])."' /&gt;
          &lt;input type='hidden' name='item[$i][Pidno]' id='Pidno' value='".htmlspecialchars($row['Pidno'])."' /&gt;
        &lt;/td&gt;
        &lt;td&gt;".htmlspecialchars($row['Price'])."&lt;/td&gt;
        &lt;td&gt;&lt;a href='deleteproduct.php?del=".htmlspecialchars($row['Pidno'])."'&gt;delete&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;";
  }
</code></pre>
