$insertsql=<<<EOT
insert into tb_manager values(null,'$name','$pwd','1');
select @pid:=last_insert_id();//寻找最新插入记录ID并赋值给pid,pid进行传值
insert into tb_mastergroup values(null,@pid,'$name',2,'1','MR');
EOT;
$sql=mysql_query($insertsql);
转载于:https://www.cnblogs.com/Dong-Ge/p/4513544.html