【CakePHP】直前にsave()したレコードのidを取得する

CakePHPで直前にインサートしたレコードのIDを取得してくる。

$this->Table->save($this->data);
$last_id = $this->Table->getLastInsertID();

【参考URL】
http://xtw.me/XlrgHB

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x