Hey all
im trying to insert info into one table thats not the problem but what is the problem is im also trying to add the amount from the form with the current amount from another table and then re insert the new amount back into the table
foreach($_SESSION as $key => $value) {
$key = $value;
}
echo
$item_number . "<br>" .
$po_number . "<br>" .
$lot_number . "<br>" .
$amount ;
$query = "SELECT * FROM invintory WHERE item_number ='$item_number'";
$result = mysql_query($query)
or die ("couldnt execute query." . mysql_error());
while ($row = mysql_fetch_array($result))
{
$onhand = $rows['onhand'];
}
echo
$onhand;
$newamount=$onhand+$amount;
echo
$newamount;
mysql_query("INSERT INTO invintory WHERE item_number ='$item_number'(onhand)
values ('$newamount')");
mysql_query("INSERT INTO recvied(item_number,po_number,lot_number,amount)
values ('$item_number','$po_number','$lot_number','$amount')");
?>
it inserts the info into recvied but i can not get the addition part to work in the invintory table