From 8380454e32b082160565d65c0fe444612ab94056 Mon Sep 17 00:00:00 2001 From: Alexandre Rossi Date: Wed, 15 Jul 2015 08:44:22 +0200 Subject: [PATCH] fix db_prefix not working (#686) --- daos/mysql/Items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daos/mysql/Items.php b/daos/mysql/Items.php index 854d46f589..3f4fe1f542 100644 --- a/daos/mysql/Items.php +++ b/daos/mysql/Items.php @@ -404,7 +404,11 @@ public function numberOfUnread() { * @return array mount of total, unread, starred entries in database */ public function stats() { - $res = \F3::get('db')->exec('SELECT COUNT(*) AS total, '.$this->stmt->sumBool('unread').' AS unread, '.$this->stmt->sumBool('starred').' AS starred FROM items;'); + $res = \F3::get('db')->exec('SELECT + COUNT(*) AS total, + '.$this->stmt->sumBool('unread').' AS unread, + '.$this->stmt->sumBool('starred').' AS starred + FROM '.\F3::get('db_prefix').'items;'); return $res[0]; } }