My Table Structure is:
DROP TABLE IF EXISTS `child`; CREATE TABLE `child` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, PRIMARY KE
The syntax for setting the variable is incorrect, use : like,
:
SET parent_id := LAST_INSERT_ID(); SET child_id := LAST_INSERT_ID();
or You can do the setting as
select LAST_INSERT_ID() into parent_id;