r1267 + and even more reident
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Nov 2007 09:28:12 +0000 (09:28 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 14 Nov 2007 09:28:12 +0000 (09:28 +0000)
inc/functions.php

index f5f5cfd..5eecd7a 100644 (file)
@@ -518,20 +518,14 @@ function getIPAddress ($ip=0)
                "where ip = INET_ATON('$ip')";
        $result = $dbxlink->query ($query);
        if ($result == NULL)
-       {
                return NULL;
-       }
-       else
+       if ($row = $result->fetch (PDO::FETCH_ASSOC))
        {
-               if ($row = $result->fetch (PDO::FETCH_ASSOC))
-               {
-                       $ret['exists'] = 1;
-                       $ret['ip_bin'] = $row['ip'];
-                       $ret['ip'] = $ip;
-                       $ret['name'] = $row['name'];
-                       $ret['reserved'] = $row['reserved'];
-               }
-               $result->fetch (PDO::FETCH_ASSOC);
+               $ret['exists'] = 1;
+               $ret['ip_bin'] = $row['ip'];
+               $ret['ip'] = $ip;
+               $ret['name'] = $row['name'];
+               $ret['reserved'] = $row['reserved'];
        }
        $result->closeCursor();
 
@@ -557,8 +551,6 @@ function getIPAddress ($ip=0)
                        $count++;
                }
                $result1->closeCursor();
-
-
        }
 
        return $ret;