diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-05-06 05:01:23 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-05-06 05:01:23 +0300 |
| commit | 9735ff83cc822cb61bc40ddfc8a433eea92cd5ea (patch) | |
| tree | 38415fa86f80a373ec3aaadac29d5b6b97c41735 | |
| parent | ea6f42dc612d6af0178d4451a06f98c550614db9 (diff) | |
use RETURNING syntax when creating base filter record
| -rw-r--r-- | classes/Pref_Filters.php | 6 |
1 files changed, 1 insertions, 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']; |