Hi, im struggling with triggers but i can make this works because of bad
sintax, i hope someone can give me a hand

CREATE TRIGGER trigger_actualize AFTER INSERT ON usuarios_imgvid
   FOR EACH ROW
    IF NEW.type="IMG"
    THEN
    UPDATE users_status E SET images=images+1 WHERE E.id_usr = NEW.id_usr
    END IF;


this is giving me an error of sintax

#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 ''
at line 5


thanks a lot

You're using compound statement syntax (the IF-THEN-END), so you
need to enclose the body within BEGIN/END.

http://dev.mysql.com/doc/refman/5.0/en/begin-end.html

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to