Skip to content

Commit

Permalink
fix lastInsertId() on windows.. testing 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohn committed Jun 24, 2024
1 parent b0e8164 commit 52e5b59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/PDOChainer/DBAL.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function insert($table, array $dataArr){

$sql = "INSERT INTO `{$table}` ({$fields}) VALUES ({$params})";
$this->pdo->prepare($sql)->bindValues($values)->execute();
return (bool) $this->pdo->lastInsertId();
return (int) $this->pdo->lastInsertId();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PDOChainer/PDOChainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public function query($query) {
/**
* PDO lastInsertId.
*
* @return string Last inserted ID
* @return int|false Last inserted ID
*/
public function lastInsertId() {
return $this->pdo->lastInsertId();
Expand Down

0 comments on commit 52e5b59

Please sign in to comment.