MySQL Forums
Forum List  »  Triggers

MYSQL trigger insert into another table for each user from a third table
Posted by: Richard Duncan
Date: April 01, 2020 10:48AM

I have been trying to figure this out will no good results after researching the internet for a couple of days. It just won't click.

I want to trigger an insert into another table with the information inserted into the main table and have a line for each user of a third table.

Main structure Table A

line_id
room_id
from_name
to_name
timestamp
text_line


Destination structure Table B

line_id
user_name
room_id
from_name
to_name
timestamp
text_line


List of users table Table C

user_id
user_name
user_room
timestamp
status

When there is an insert on table A, an insert is done into table b with the same information from table a for each user_name in table c.

I feel like Einstein. I have found a 1000 ways not to do it.

Options: ReplyQuote


Subject
Views
Written By
Posted
MYSQL trigger insert into another table for each user from a third table
151
April 01, 2020 10:48AM


Sorry, only registered users may post in this forum.

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.