I'm back with another absolute beginner question, I have values stored in a database, my goal is to allow users to either subtract or add to a specific database value (quantity) using a drop down menu with values from ranging from 1 - 10. I'm keeping it simple for now.
mysql_select_db("toner", $con);
$sql=INSERT INTO inventory (partnumber, quantity)
VALUES
('$_POST[partnumber]','$_POST[quantity]');
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
I can find plenty of examples just adding or deleting a static value however that's not what I need. I've searched around and few examples resembling what I'm looking for 1 & 2 It seems as though UPDATE would be the best solution however I'm not sure exactly how it should be implemented, I've also looking into concatenation but I'm not sure it can accomplish what I need, any assistance you can offer this novice is appreciated. Thanks