diff --git a/core/database_pdo.php b/core/database_pdo.php index 0c0639f..f8db49c 100644 --- a/core/database_pdo.php +++ b/core/database_pdo.php @@ -56,23 +56,23 @@ class Database extends PDO /** * Извлекает из базы все элементы по запросу */ - public function fetchAllArray($query) + public function fetchAllArray($query,$values=null) { $sth = $this->prepare($query); - $sth->setFetchMode(PDO::FETCH_ASSOC); - $sth->execute(); - return $sth->fetchAll(); + $prep = $this->prepareValues($values); + $sth->execute($prep); + return $sth->fetchAll(PDO::FETCH_ASSOC); } /** * Извлекает из базы первый элемент по запросу */ - public function fetchOneArray($query) + public function fetchOneArray($query,$values=null) { $sth = $this->prepare($query); - $sth->setFetchMode(PDO::FETCH_ASSOC); - $sth->execute(); - return $sth->fetch(); + $prep = $this->prepareValues($values); + $sth->execute($prep); + return $sth->fetch(PDO::FETCH_ASSOC); } private function assignQuote($x, $y)