title: MySQL CREATE TRIGGER and DELIMITER ISSUES
body: <p>I am trying to make a database that does some inventory checking, and I am working on some triggers to update everything as required. In this case, that I want to do is to take the current availability (disponibilidad) of an ingredient from the ingredients table, add to it how much is taken or added, and then save that value into the table <code>stock_disponibilidad</code>, as you can see from the trigger code I am trying to use.</p>
  
  <pre><code>DELIMITER $$
  
  CREATE TRIGGER `update_disponibilidad_variacion` BEFORE INSERT ON `stock_disponibilidad`
  FOR EACH ROW BEGIN
  DECLARE old_disp DOUBLE DEFAULT 0;
  SELECT disponibilidad INTO old_disp FROM ingredientes WHERE id = NEW.ingredientes_id;
  NEW.disponibilidad = old_disp + NEW.variacion;
  END$$
  
  DELIMITER ;
  </code></pre>
  
  <p>However, whenever I execute the query to create the trigger, I get the following error:</p>
  
  <pre><code>#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.disponibilidad = old_disp + NEW.variacion; END' at line 5
  </code></pre>
  
  <p>I've done everything I read about this issue, still without result. What am I doing wrong?</p>