MySQL Forums
Forum List  »  Views

Re: Updating 1 table with values of the insert query
Posted by: Mahir Zukic
Date: May 25, 2011 12:27PM

It's ok, I've found a solution to this. Just made a trigger that goes like this


create trigger registration
after insert on users
FOR EACH ROW
begin
insert into count values(new.IDuser, new.Firstname, new.Lastname, 0);
/* insert into uplate values('', new.IDuser, 30, curdate()); */
insert into visits values('', new.IDuser, new.Firstname, new.Lastname, curdate());
end$

EDIT: forgot to say that $ was the delimiter



Edited 1 time(s). Last edit at 05/25/2011 12:28PM by Mahir Zukic.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Updating 1 table with values of the insert query
1364
May 25, 2011 12:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.