Copying table into another

Hello

I have two tables.

Pending (id, uid, data)
Approved (id, uid, data)

When data is submitted it is inserted into the pending table. Once approved I want the data to be transferred into the approved table.

you can write a trigger
like

CREATE TRIGGER myTrigger
AFTER INSERT ON PENDING
FOR EACH ROW
BEGIN
CHK HERE APPROVED CONDIN

IF APPROVED
INSERT INTO Approved (id, uid, data) values(id, uid, data)

END

you should really have only one table, with a status column

then instead of “transferring” rows from one table to another, you simply update the status