Skip to content

Commit 8d92e8e

Browse files
committed
Fixes
1 parent f3e30d6 commit 8d92e8e

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

src/dbpp/DBPP.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/dbpp/attrs/Insert.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class Insert extends Query {
1818

1919
public function execute(PDO $pdo, array $args): array|bool {
2020
if(($stmt = $pdo->prepare($this->query))
21-
&&$this->bindValues($stmt, $args)) {
21+
&&$this->bindValues($stmt, $args)
22+
&&$stmt->execute()) {
2223
$response = [];
2324

2425
foreach($this->keys as $key)

src/dbpp/attrs/Query.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ public function __construct(
1313
protected string $query
1414
) {}
1515

16-
public function execute(PDO $pdo, array $args): mixed {
16+
public function execute(PDO $pdo, array $args): array|bool {
1717
if(($stmt = $pdo->prepare($this->query))
18-
&&$this->bindValues($stmt, $args)) {
18+
&&$this->bindValues($stmt, $args)
19+
&&$stmt->execute()) {
1920
return $stmt->fetchAll();
2021
}
2122

@@ -29,7 +30,8 @@ protected function bindValues(PDOStatement $statement, array $args): bool {
2930
$type = PDO::PARAM_INT;
3031
}
3132

32-
$statement->bindValue($key, $value, $type);
33+
if($statement->bindValue($key, $value, $type))
34+
return false;
3335
}
3436

3537
return true;

src/dbpp/attrs/Update.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Update extends Query {
2020

2121
public function execute(PDO $pdo, array $args): bool {
2222
return ($stmt = $pdo->prepare($this->query))
23-
&&$this->bindValues($stmt, $args);
23+
&&$this->bindValues($stmt, $args)
24+
&&$stmt->execute();
2425
}
2526
}

0 commit comments

Comments
 (0)