I'm trying to edit the specific item for each row found in the snippet 
below. Each item gets a row in a table and I want to pass the item Id (s_id 
below) to $item. It seems however that the array *item * is not 
incrementing. For all rows I get the value of the first row. 
Any ideas of what wrong? 

M.

<? 
/*
  Get isstock value and if there is stock registered add a table row for 
each item.
*/
if ($isstock >0) {
  for ($i = 0; $i <= $isstock -1; $i++) {
    $item[$i] = $row['s_id'];
    print "<input type='hidden' name='what' value=$item[$i]>";
    $row = mysql_fetch_array($query_res);
    print "<tr>";
    print "     <td>".$row['s_id']."</td>";
    print "     <td>".$row['s_description']."</td>";
    print "     <td>".$row['s_price']."</td>";
    print "     <td>".$row['s_stock_quantity']."</td>";
    print "     <td>N/I</td>";
    print "     <td>N/I</td>";
    print "     <td><input name='action' value='Edit' type='submit'><input 
name='action' value='Delete' type='submit'></td>";
    print "</tr>";
  }
}
?>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to