From 9735ff83cc822cb61bc40ddfc8a433eea92cd5ea Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 6 May 2025 05:01:23 +0300 Subject: use RETURNING syntax when creating base filter record --- classes/Pref_Filters.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php index a6063d898..40fc99600 100644 --- a/classes/Pref_Filters.php +++ b/classes/Pref_Filters.php @@ -689,14 +689,10 @@ class Pref_Filters extends Handler_Protected { $sth = $this->pdo->prepare("INSERT INTO ttrss_filters2 (owner_uid, match_any_rule, enabled, title, inverse) VALUES - (?, ?, ?, ?, ?)"); + (?, ?, ?, ?, ?) RETURNING id"); $sth->execute([$_SESSION['uid'], $match_any_rule, $enabled, $title, $inverse]); - $sth = $this->pdo->prepare("SELECT MAX(id) AS id FROM ttrss_filters2 - WHERE owner_uid = ?"); - $sth->execute([$_SESSION['uid']]); - if ($row = $sth->fetch()) { $filter_id = $row['id']; -- cgit v1.2.3-54-g00ecf