From 857f58879022e7ab8dcc30380ee00df5277b8c0c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 21 May 2020 20:55:06 +0200 Subject: Fix fetch preview (#2993) * Fix fetch preview #fix https://github.com/FreshRSS/FreshRSS/issues/2923 In MariaDB / MySQL, we cannot start a new query if we have not consumed the previous buffered query fully. * Fix for reload * Typo in comment --- app/Models/FeedDAO.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'app/Models') diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 11db5e3d4..6f675ead0 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -258,12 +258,10 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { } public function searchById($id) { - $sql = 'SELECT * FROM `_feed` WHERE id=?'; + $sql = 'SELECT * FROM `_feed` WHERE id=:id'; $stm = $this->pdo->prepare($sql); - - $values = array($id); - - $stm->execute($values); + $stm->bindParam(':id', $id, PDO::PARAM_INT); + $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_ASSOC); $feed = self::daoToFeed($res); -- cgit v1.2.3