Hi, I have a web-based inventory system that uses a MySQL database. First a user inputs a brand to search for, then he is asked which items (in that brand) he wishes to update. The users is then brought to an update page that should (I NEED HELP!) allow him to increment or decrement the present quantity in inventory. This project utilizes PHP, MySQL, and Javascript. Currently, I can increment or decrement only one item. I need to be able to increment each individual textbox for database updating. How do I do it?


<html>
<title>Update Selections</title>
<body>
<?php
include("menu.php");
include("sqlconnect.php");


?>
<script type="text/javascript">

function add()
{
var TextBoxValue = document.getElementById("value");
var number = parseInt(TextBoxValue.value, 10);
TextBoxValue.value = number + 1;
}

function subtract()
{
var TextBoxValue = document.getElementById("value");
var number = parseInt(TextBoxValue.value, 10);
TextBoxValue.value = number - 1;
if (TextBoxValue.value < 0)
{
alert("The present quantity cannot be less than 0!");
TextBoxValue.value = 0;
}
}

</script>


<p align="center"><b>Make Updates:</b>
<br />
<br />
The following items were selected for quantity update:
<br />
<br />
<table border="1">
<tr><th>Item:</th>
<th>QUANTITY</th>
<th>ADD/SUBTRACT</th></tr>
<style>
textarea {resize: none;}
</style>
<?php

//$row_id = $_POST['itemselect'];
foreach ($_POST['itemselect'] as $confirm)
{

$result = mysql_query("SELECT * FROM inventory WHERE id='$confirm'");
while ($row = mysql_fetch_array($result))
{
echo "<tr><td>" . $row['Item'] . "</td>";
echo "<td bgcolor='grey'><input type='text' id='value' name='itemupdate[]' disabled='disabled' style='text-align: center' value='" . $row['QuaninInventory'] . "'></td>";
echo "<td><div align='center'><input type='button' value='+' onclick='add()'><input type='button' value='-' onclick='subtract()'></div></td></tr>";

}
}
echo "</table>";
?>
<br />
<br />
<INPUT TYPE="BUTTON" VALUE="<-- Back to Results" ONCLICK="window.location.href='http://localhost/Inventory/quantitybybrandprocess.php'">
</p>
</body>
</html>