Skip to content

Commit

Permalink
Mpdo extension fix.
Browse files Browse the repository at this point in the history
Close #1900,#1898
  • Loading branch information
jamesallsup committed Oct 2, 2014
1 parent 938fb69 commit 9acc10a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# OpenCart 2.0 change log

## v2.0.0.1 (Pending)
#### Bugs fixed
* Changed mpdo database driver to use correct name space reference.

#### Changes
None

#### Added
None
12 changes: 6 additions & 6 deletions upload/system/library/db/mpdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function prepare($sql) {
$this->statement = $this->pdo->prepare($sql);
}

public function bindParam($parameter, $variable, $data_type = PDO::PARAM_STR, $length = 0) {
public function bindParam($parameter, $variable, $data_type = \PDO::PARAM_STR, $length = 0) {
if ($length) {
$this->statement->bindParam($parameter, $variable, $data_type, $length);
} else {
Expand All @@ -35,16 +35,16 @@ public function execute() {
if ($this->statement && $this->statement->execute()) {
$data = array();

while ($row = $this->statement->fetch(PDO::FETCH_ASSOC)) {
while ($row = $this->statement->fetch(\PDO::FETCH_ASSOC)) {
$data[] = $row;
}

$result = new stdClass();
$result = new \stdClass();
$result->row = (isset($data[0])) ? $data[0] : array();
$result->rows = $data;
$result->num_rows = $this->statement->rowCount();
}
} catch(PDOException $e) {
} catch(\PDOException $e) {
trigger_error('Error: ' . $e->getMessage() . ' Error Code : ' . $e->getCode());
}
}
Expand All @@ -66,15 +66,15 @@ public function query($sql, $params = array()) {
$result->rows = $data;
$result->num_rows = $this->statement->rowCount();
}
} catch (PDOException $e) {
} catch (\PDOException $e) {
trigger_error('Error: ' . $e->getMessage() . ' Error Code : ' . $e->getCode() . ' <br />' . $sql);
exit();
}

if ($result) {
return $result;
} else {
$result = new stdClass();
$result = new \stdClass();
$result->row = array();
$result->rows = array();
$result->num_rows = 0;
Expand Down

0 comments on commit 9acc10a

Please sign in to comment.