데이터베이스/MYSQL
lastInsertId
죠부니
2019. 8. 14. 14:31
반응형
최근등록한 값의 id를 반환
- AUTO_INCREMENT에 따라 생성된 최근 ID
$db->liastinsertId();
https://www.php.net/manual/en/pdo.lastinsertid.php
PHP: PDO::lastInsertId - Manual
I think I get a nice solution in Postgres to get the ID using the RETURNING that comes with Postgress since version 8.2. In the example below, I add to my insert clause the "returning" along with the primary key of my table, then after the execute, I do a
www.php.net
https://zetawiki.com/wiki/MySQL_LAST_INSERT_ID()
MySQL LAST INSERT ID() - 제타위키
다음 문자열 포함...
zetawiki.com
반응형