Używam Postgresql, kiedy chcę użyć PDO, aby pobrać najnowszy identyfikator wstawiania, mam problem. Tu jest mój kodu:LastInsertId nie działa w Postgresql
$db->lastInsertId('columnName');
Komunikat o błędzie mówi
SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "columnName" does not exist
Chyba mam jakieś nieporozumienie o „obiektu sekwencji” zamieszczonego w podręczniku PHP.
Note:
Returns the ID of the last inserted row, or the last value from a sequence object,
depending on the underlying driver. For example, PDO_PGSQL() requires you to specify the
name of a sequence object for the name parameter.
Obecnie "columnName" jest ciągiem tego automatycznie zwiększanego atrybutu. Czy ktoś może wskazać, gdzie popełniłem błąd? Dzięki.
Prawdopodobny duplikat [Uzyskaj ostatni identyfikator wkładki po przygotowanym wkładzie z PDO] (http://stackoverflow.com/questions/5057954/get-last-insert-id-after-a-prepared-insert-with-pdo) –