반응형
최근등록한 값의 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
반응형
'데이터베이스 > MYSQL' 카테고리의 다른 글
DELETE LEFT JOIN (0) | 2020.02.18 |
---|---|
시구동 관련 법정동 자료 (0) | 2020.01.17 |
ROWNUM (0) | 2020.01.13 |
TINYBLOB, BLOB, MEDIUMBLOB and LONGBLOB 자료형 (0) | 2018.11.02 |
MYSQL 자주사용하는 명령어 (0) | 2018.07.08 |