]> git.wh0rd.org Git - tt-rss.git/commitdiff
pdo: set warnings
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 1 Dec 2017 13:56:15 +0000 (16:56 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 1 Dec 2017 13:56:15 +0000 (16:56 +0300)
classes/article.php
classes/db.php

index 8fb863ef240381852bd7055327dab8f03a11fc8d..8f59e2b8d66813566e20b12a9f3ca65a89ebdafc 100644 (file)
@@ -274,7 +274,7 @@ class Article extends Handler_Protected {
                $tags_str = db_escape_string($_REQUEST["tags_str"]);
                $tags = array_unique(trim_array(explode(",", $tags_str)));
 
-               db_query("BEGIN");
+               $this->pdo->beginTransaction();
 
                $result = db_query("SELECT int_id FROM ttrss_user_entries WHERE
                                ref_id = '$id' AND owner_uid = '".$_SESSION["uid"]."' LIMIT 1");
@@ -319,7 +319,7 @@ class Article extends Handler_Protected {
                                                AND owner_uid = " . $_SESSION["uid"]);
                }
 
-               db_query("COMMIT");
+               $this->pdo->commit();
 
                $tags = Article::get_article_tags($id);
                $tags_str = $this->format_tags_string($tags, $id);
index 0ef3e3f438f74829f3aa0592a461bff0e955570f..94dec766e74c9bcb137087af8be8e7211841bf68 100644 (file)
@@ -31,6 +31,8 @@ class Db implements IDb {
                        DB_USER,
                        DB_PASS);
 
+               $this->pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
+
                if (!$this->pdo) {
                        print("Error connecting via PDO.");
                        exit(101);