use RETURNING syntax when creating base filter record
This commit is contained in:
@@ -689,14 +689,10 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
|
|
||||||
$sth = $this->pdo->prepare("INSERT INTO ttrss_filters2
|
$sth = $this->pdo->prepare("INSERT INTO ttrss_filters2
|
||||||
(owner_uid, match_any_rule, enabled, title, inverse) VALUES
|
(owner_uid, match_any_rule, enabled, title, inverse) VALUES
|
||||||
(?, ?, ?, ?, ?)");
|
(?, ?, ?, ?, ?) RETURNING id");
|
||||||
|
|
||||||
$sth->execute([$_SESSION['uid'], $match_any_rule, $enabled, $title, $inverse]);
|
$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()) {
|
if ($row = $sth->fetch()) {
|
||||||
$filter_id = $row['id'];
|
$filter_id = $row['id'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user