可能重复:
如何获取使用 DBI 插入的最后一行?
我需要能够调用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
我怎样才能做到这一点?