Closed RonEskinder closed 3 years ago
Hi, there is no function to determine the new ID. You must use PostgreSQL functionality with a RETURNING (https://www.postgresql.org/docs/12/dml-returning.html), for example:
INSERT INTO users (firstname, lastname) VALUES ('Joe', 'Cool') RETURNING id;
On this query, you can call fetchSingle()
method and you will get a new ID as integer.
I have an insert and need to know the last inserted id for that query. Is there a method not documented that i can use for this?
This will only show affected rows, but no info about the id