From 23fcc4d641182985841483c8499cdf194c716e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 3 May 2014 17:52:08 +0200 Subject: [PATCH] Use executeQuery as often as possible. re #49, #48 --- author.php | 4 ++-- book.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/author.php b/author.php index a60ad2c..ba871ce 100644 --- a/author.php +++ b/author.php @@ -47,10 +47,10 @@ class Author extends Base { } public static function getAllAuthorsByFirstLetter() { - $result = parent::getDb ()->query('select substr (upper (sort), 1, 1) as title, count(*) as count + list (, $result) = parent::executeQuery ("select {0} from authors group by substr (upper (sort), 1, 1) -order by substr (upper (sort), 1, 1)'); +order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array (), -1); $entryArray = array(); while ($post = $result->fetchObject ()) { diff --git a/book.php b/book.php index 1ac4691..60f4189 100644 --- a/book.php +++ b/book.php @@ -539,10 +539,10 @@ where data.book = books.id and data.id = ?'); } public static function getAllBooks() { - $result = parent::getDb ()->query("select substr (upper (sort), 1, 1) as title, count(*) as count + list (, $result) = parent::executeQuery ("select {0} from books group by substr (upper (sort), 1, 1) -order by substr (upper (sort), 1, 1)"); +order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", self::getFilterString (), array (), -1); $entryArray = array(); while ($post = $result->fetchObject ()) {