在制作commit
之前,如何在PHP 中使用事务插入后获得row ID
$qry = $con->prepare("/* query */");
$con->beginTransaction();
$qry->execute();
$last_id = $con->lastInsertId(); // This
$con->commit();
请求您的pdo对象给出插入的最后一个id:
$lastId = $pdoObject->lastInsertId();
在制作commit
之前,如何在PHP 中使用事务插入后获得row ID
$qry = $con->prepare("/* query */");
$con->beginTransaction();
$qry->execute();
$last_id = $con->lastInsertId(); // This
$con->commit();
请求您的pdo对象给出插入的最后一个id:
$lastId = $pdoObject->lastInsertId();