title: Trigger Error , MySQL
body: <p>Well, I have researched and have not found a solution to the following problem <code>'SQL Error (1442): Can not update table' messages' in stored function / trigger because it is already used by statement Which invoked this stored function / trigger.</code> `</p>
  
  <p>My trigger is created, only when I run the INSERT on the table of messages, this error is thrown, my trigger is </p>
  
  <pre><code>DELIMITER $$ 
  DROP TRIGGER IF EXISTS `onMessage` ;
  CREATE TRIGGER `onMessage` BEFORE INSERT ON `messages` FOR EACH ROW 
  BEGIN
         UPDATE `users` SET `users`.`messages` = ( `users`.`messages` + 1 ) 
         WHERE `users`.`uid` = NEW.uid ;
         DELETE FROM `messages` WHERE `date` &lt; ( NOW( ) - INTERVAL 1 MINUTE ) ;
  END ;
  $$
  DELIMITER ;
  </code></pre>