dbView_Item.php
$id = isset($POST['id']);
$item_code = isset($POST['item_code']);
$description = isset($POST['description']);
$quantity = isset($POST['quantity']);
$category = isset($POST['category']);
$c_qty = isset($POST['c_qty']);
$co_qty = isset($_POST['co_qty']);
if(isset($_POST['quantity']) > 0)
{
$co_qty = $quantity - $c_qty;
}
$query = "UPDATE stationary SET co_qty='$co_qty', description='$description', category='$category' where item_code='$id' ";
mysql_query($query) or die("not insert");
View.php
<td><form name="form1" method="post" action="dbView_Item.php">
<table width="80%" border="1" align="center" cellpadding="0" cellspacing="1" bordercolor="#CCCCCC">
<tr>
<td width="18%" bgcolor="#E0E2EB">Description : </td>
<td width="82%"><? echo $row['description']; ?></td>
<input type="hidden" name="id" value="<? echo $row['item_code']; ?>">
<tr>
<td bgcolor="#E0E2EB">Category : </td>
<td width="82%"><? echo $row['category']; ?></td>
</tr>
<tr>
<td bgcolor="#E0E2EB">Item Code : </td>
<td width="82%"><? echo $row['item_code']; ?></td>
<tr>
<td bgcolor="#E0E2EB">Current Quantity: </td>
<td width="82%"><? echo $row['quantity']; ?></td>
</tr>
<tr>
<td bgcolor="#E0E2EB">Required Quantity : </td>
<td><input name="c_qty" type="text" id="ct_qty" size="10" maxlength="10"></td>
</tr>
</table>
<br>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="67%"><div align="right">
<input name="Cancel" type="button" id="Cancel" value="Cancel" onClick="history.go(-1)">
<input name="Submit" type="submit" onClick="MM_validateForm('description','','R','quantity','','RisNum','item_code','','R');return document.MM_returnValue" value="Submit">
when i run it, it says "not insert"..can anyone tell me how to fix it?