Is it possible to retrieve the rowid of the last inserted Oracle row in PHP? I was trying: With no luck. I’m getting the error define not done before fetch or execute and fetch at the fetch line. Answer Declare: Use: Bind your variable to a PHP variable: