zend framework2 - postgresql RETURNING in zf2 table gateway -


how 1 add returning clause in insert via table gateway ?

insert users (name, age) values ('liszt', 10) returning id; 

$dataarray = array('name'=> 'liszt','age' => 10); $this->tablegateway->insert($dataarray); $userid = $this->tablegateway->lastinsertvalue;  

another method :

$userid = $this->tablegateway->getlastinsertvalue(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -