Workarounds for empty referal id
authorRoland Häder <roland@mxchange.org>
Tue, 3 Nov 2009 16:34:38 +0000 (16:34 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 3 Nov 2009 16:34:38 +0000 (16:34 +0000)
inc/libs/online_functions.php

index fb7dfc7..95643bc 100644 (file)
@@ -86,7 +86,7 @@ SET
        `action`='%s',
        `what`='%s',
        `userid`=%s,
-       `refid`=%s,
+       `refid`='%s',
        `is_member`='%s',
        `is_admin`='%s',
        `timestamp`=UNIX_TIMESTAMP(),
@@ -107,7 +107,7 @@ LIMIT 1",
                ), __FUNCTION__, __LINE__);
        } else {
                // No entry does exists so we simply add it!
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, %s, '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_online` (`module`, `action`, `what`, `userid`, `refid`, `is_member`, `is_admin`, `timestamp`, `sid`, `ip`) VALUES ('%s','%s','%s', %s, '%s', '%s','%s', UNIX_TIMESTAMP(), '%s','%s')",
                        array(
                                getModule(),
                                getAction(),
@@ -125,7 +125,7 @@ LIMIT 1",
        SQL_FREERESULT($result);
 
        // Purge old entries
-       SQL_QUERY("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})", __FUNCTION__, __LINE__);
+       SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
 }
 
 // [EOF]