Skip to content

Commit 52befee

Browse files
committed
- Changes Database-Interface
1 parent 67435e2 commit 52befee

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Database.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ public function prepare($query);
2121

2222
/**
2323
* @param string $query
24+
* @param array $params
2425
* @return int
2526
*/
26-
public function exec($query);
27+
public function exec($query, array $params = array());
2728

2829
/**
2930
* @return int

src/Databases/MySQL.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ public function prepare($query) {
5353

5454
/**
5555
* @param string $query
56+
* @param array $params
5657
* @return int
5758
*/
58-
public function exec($query) {
59-
return $this->pdo->exec($query);
59+
public function exec($query, array $params = array()) {
60+
$stmt = $this->pdo->query($query);
61+
$stmt->execute($params);
62+
$result = $stmt->rowCount();
63+
$stmt->closeCursor();
64+
return $result;
6065
}
6166

6267
/**

0 commit comments

Comments
 (0)