title: Update the same row multiple times
body: <p>I'm trying to increment a row when in the form's the item is selected. I know that doing an update statement does what I ask but my question is: if in the form there is 5 or 10 fields that the user can choose at the same time the same item, How can I update the same row in the same time to save the X number of times that the same item was chosen?</p>
  
  <p>My table is this:</p>
  
  <pre><code>---materials--- (table name)
  id (int)
  mat_name (varchar)
  quantity (int)
  used  (int)
  existence (int)
  </code></pre>
  
  <p>The row I need to raise with "1" when the item was choose is "used"</p>
  
  <p>In the table of "materials" there are like 100 of items like:</p>
  
  <p>onions,
  pears,
  broccoli,
  etc..</p>
  
  <p>So the idea is when some item was selected for whatever in the table that item will be increment in 1 in the row "used" and with a simple substraction show how much quantity of every item remains in existence </p>
  
  <p>my query could look something like this:</p>
  
  <pre><code>$statement = "UPDATE materials
      SET used = :used,
      WHERE mat_name = :mat_name";
  $stmt = $conn-&gt;prepare($statement);
  $stmt-&gt;bindParam(':used', $_POST['used'], PDO::PARAM_INT);
  $stmt-&gt;bindParam(':mat_name', $_POST['mat_name'], PDO::PARAM_STR);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>Thanks for any help!</p>