CREATE TRIGGER `after_insert_images_clients` 
AFTER INSERT ON `images` 
FOR EACH ROW 
BEGIN 
IF NEW.type="cover" THEN 
UPDATE clients SET cover = NEW.path WHERE code=NEW.code ; 
END IF;
 IF NEW.type="profile" 
THEN 
UPDATE clients SET profile = NEW.path WHERE code=NEW.code ; 
END IF; END