php - Get last insert id after a prepared insert with PDO - Stack Overflow
From the PHP manual: For example, PDO_PGSQL() requires you to specify the name of a sequence object for the name parameter. You could also use RETURNING in the INSERT-statement and fetch the INSERT-result like a SELECT result....