More fixes for registration if ext-cache and many more are absend
[mailer.git] / ref.php
diff --git a/ref.php b/ref.php
index 95e6400a434320925e45b232f6372166ff0f4954..33b656e747e5aaf685ecc58197191680f3ec6391 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -74,8 +74,14 @@ if (!empty($ref)) {
                $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' LIMIT 1",
                        array($ref), __FILE__, __LINE__);
 
-               // Load userid
-               list($ref) = SQL_FETCHROW($result);
+               // Do we have an entry?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load userid
+                       list($ref) = SQL_FETCHROW($result);
+               } else {
+                       // No entry found
+                       $ref = 0;
+               }
 
                // Free result
                SQL_FREERESULT($result);