title: Infinite loop execute while using trigger
body: <p>I am using following code:</p>
  
  <pre><code>DELIMITER $$
  DROP TRIGGER IF EXISTS after_insert_temp_ecs $$
  CREATE 
      TRIGGER `after_insert_temp_ecs` AFTER insert ON `ecs` 
      FOR EACH ROW BEGIN
  set @count =1;
  WHILE(@count&lt;=NEW.installments) THEN
  insert into temp_ecs (amount_temp,_date_temp,id,name,installments) values(NEW.amount,(date_add(NEW._date,interval @count month)),NEW.id,NEW.name,NEW.installments);
  set @count=@count+1;
  END WHILE;
  END;
  $$
  DELIMITER ;
  </code></pre>
  
  <p>But when I use it infinite loop execute. What's the error in the code</p>