Closed ghost closed 3 years ago
Please update README.md and INSERT.md documentation, the argument for INSERT execute() must be TRUE or undefined to return insert id.
This looks wrong: $insertId = $insertStatement->execute( false );
$insertId = $insertStatement->execute( false );
As it stands in source code, the value must be TRUE or undefined.
/** * @param bool $insertId * * @return string */ public function execute($insertId = true) { if (!$insertId) { return parent::execute(); } parent::execute(); return $this->dbh->lastInsertId(); }
I have updated the way this works in 2.2 so that it returns the statement which you can call ->lastInsertId() against.
->lastInsertId()
Please update README.md and INSERT.md documentation, the argument for INSERT execute() must be TRUE or undefined to return insert id.
This looks wrong:
$insertId = $insertStatement->execute( false );
As it stands in source code, the value must be TRUE or undefined.