Tag Archives: cakephp tutorials for beginner
Cakephp get last insert id
Cakephp get last insert id : If you working with cakephp database and performing insert operation tables you often need to get last inserted id because it is important for further processing. Here we are going to explain the last inserted id when you are performing the insert operation in cakephp.
Cakephp get last insert id Syntax
You can use You can get last inserted in cakephp as below-
:
$lastInsertedId = $this->ModelName->getInsertID(); |
Or You can also use the below method to get last Insert Id.
:
$lastInsertedId = $this->ModelName->getLastInsertID(); |
You Can use either method to get the last insert id in cakephp
Get current datetime in cakephp
Get current datetime in cakephp : If you are working with cake php you often need to work with date time function to get current date time in cakephp. Here we are going to explain the date time in cakephp.
Get current datetime in cakephp Syntax
You get current date time in cakephp as below
Get current datetime in cakephp Syntax
|
The above function will return the current date time in cakephp.