]> git.wh0rd.org Git - tt-rss.git/commitdiff
last minute workaround for OPML import on MySQL
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 14:27:54 +0000 (15:27 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 7 Sep 2005 14:27:54 +0000 (15:27 +0100)
opml.php

index d932d8bd9e3c26956f0661324f2bb62df8bd51da..67ed9139720c92f88ef115301c422ae593ff8928 100644 (file)
--- a/opml.php
+++ b/opml.php
 
                        print "Feed <b>$title</b> ($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.<br>";
 
                        } 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 "<b>Done.</b><br>";