D
D
Dmitry Bay2015-04-18 16:55:55
PostgreSQL
Dmitry Bay, 2015-04-18 16:55:55

How to get Returning id in postgresql yii2?

Essence of the question, there is an insert request
Yii::$app->db->createCommand()->insert('services', Yii::$app->request->post()['Services'])->execute ();
(this is exactly how it should be, initially the above code is validated through Active Record)
How can I get the id of this insert in yii2?
For example, using the Returning id?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-04-20
@kawabanga

Yii::$app->db->getlastinsertid()
www.yiiframework.com/doc-2.0/yii-db-connection.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question