Knew to using triggers for databases. I'm trying to select 10 random records from one table and insert them all into another one while keeping the last insert ID. I'm currently using:
CREATE TRIGGER `Deal White Cards` AFTER INSERT ON `u`
FOR EACH ROW
INSERT INTO dh (cid, uid) VALUES
(
(SELECT `id` FROM `c` WHERE `colour` = 'w' ORDER BY RAND() LIMIT 10),
NEW.id
)
As it stands at the moment I am just receiving an error (Subquery returns more than 1 row)