From: Andrew Dolgov Date: Wed, 7 Sep 2005 14:27:54 +0000 (+0100) Subject: last minute workaround for OPML import on MySQL X-Git-Tag: 1.0.3.1~8 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b76cdb2f44755f299d94b4dba788f55d86170bc7;p=tt-rss.git last minute workaround for OPML import on MySQL --- diff --git a/opml.php b/opml.php index d932d8bd..67ed9139 100644 --- a/opml.php +++ b/opml.php @@ -43,16 +43,20 @@ print "Feed $title ($url)... "; - $result = db_query_2("SELECT id FROM ttrss_feeds WHERE + if (DB_TYPE == "mysql") { + $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); + } + + $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE title = '$title' OR feed_url = '$url'"); - if (db_num_rows($result) > 0) { + if ($result && db_num_rows($result) > 0) { print " Already imported.
"; } else { - - $result = db_query_2("INSERT INTO ttrss_feeds (title, feed_url) VALUES + + $result = db_query($link, "INSERT INTO ttrss_feeds (title, feed_url) VALUES ('$title', '$url')"); print "Done.
";