There are no auto-increment columns in Oracle, so lastInsertId is not supported in the same way as for MySQL. You must implement the equivalent manually using Oracle sequences.
Create an oracle sequence for each table that requires it and use NEXTVAL to get it when you need to insert, and then use this value when pasting into the table.
$sh = $conn->prepare('SELECT uid_seq.NEXTVAL AS nextInsertID FROM DUAL'); $sh->execute(); $nextInsertId = $sh->fetchColumn(0); $sh = $conn->prepare("INSERT INTO table (id, data) VALUES(?, 255)"); $sh->execute(array($nextInsertId));
source share