From 0a8c482b41a2e9d15449c1284933c044a62eb549 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Thu, 9 Feb 2017 12:59:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D0=B5=20update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/database_pdo.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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)