|
1
2
3
4
5
6
7
|
<?php $model = new model(); if($model -> create($data)) { $insertId = $model -> getWriteConnection() -> lastInsertId($model -> getSource()); }?> |
是的没错,就是如此的简单!
还可以在简单一点!
|
1
2
3
4
5
6
7
|
<?php $model = new model(); if($model -> create($data)) { $insertId = $model -> id; }?> |
相关博文
Phalcon获取最后插入ID lastInsertId
