ZF2: Getting last insert value from Postgresql

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ZF2: Getting last insert value from Postgresql

Sergio Gabriel Rodriguez
Hi all,
        I'm trying to get de last insert value, I use Postgres 9.3 and ZF
2.2, it is not working for me:


$this->tableGateway->insert($data);
$id = $this->tableGateway->getLastInsertValue());

My table definition has de primary key id with sequence:

it always returns an empty value.

Thanks for your help!

Sergio.