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
Post a Comment