mysqlで関数を呼び出せるようにする必要があります。一例は次のとおりです。
$dbh = DBI->connect(......)
$sqlQuery = "INSERT INTO xxx VALUES ......";
$sth = $dbh->prepare($sqlQuery);
$sth->execute();
#The missing code is here
#Call the function mysql_insert_id to retrieve the id of the last inserted record
#Do something with the id
これどうやってするの?