回答編集履歴
1
参考URL追記
answer
CHANGED
@@ -1,2 +1,4 @@
|
|
1
|
-
|
1
|
+
`lastInsertId()`はトランザクション内で最後にInsertされたIDを取得するものなので、
|
2
|
-
既にコミット済みのテーブルから取得する場合は、select max(ID) from table; にな
|
2
|
+
既にコミット済みのテーブルから取得する場合は、select max(ID) from table; になります。
|
3
|
+
|
4
|
+
参考:[https://www.php.net/manual/ja/pdo.lastinsertid.php](https://www.php.net/manual/ja/pdo.lastinsertid.php)
|