You can write a procedure for this.
DELIMITER //
CREATE PROCEDURE `proc1` (contactinformation colums... usertable columns...)
BEGIN
INSERT INTO contactinformation values(contactinformation colums ...);
INSERT INTO usertable values(LAST_INSERT_ID(), contactinformation colums ...);
END//
DELIMITER ;
contactinformation colums...means defining the columns of the contact data table.
usertable columns...means defining the columns of a usable table.
After the first insertion, you can get the insertion identifier if there is any automatic column in the contact information table. Then use this key in the second insert statement.
source
share