From: Roland Häder Date: Tue, 12 Jul 2011 21:06:17 +0000 (+0000) Subject: Also this is fixed? X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5412fb8a6c4ee57c05d9679e468f5d53a9ac44fe;p=mailer.git Also this is fixed? --- diff --git a/inc/referal-functions.php b/inc/referal-functions.php index 57b00298b1..5b26ebfab5 100644 --- a/inc/referal-functions.php +++ b/inc/referal-functions.php @@ -624,6 +624,7 @@ function flushReferalTableToDatabase ($userid) { // Prepare SQL $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES '; + $executeSql = false; // Now walk through the array, first levels foreach ($GLOBALS['referal_refid'][$userid] as $level=>$levelArray) { @@ -643,6 +644,9 @@ function flushReferalTableToDatabase ($userid) { if ($count == 0) { // Then add it to the SQL $SQL .= '(' . $userid . ',' . $level . ',' . $refid . '),'; + + // Some has been added, so execute the query + $executeSql = true; } // END - if } // END - foreach } // END - foreach @@ -652,7 +656,9 @@ function flushReferalTableToDatabase ($userid) { // And run it //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',SQL=' . $SQL); - SQL_QUERY($SQL, __FUNCTION__, __LINE__); + if ($executeSql === true) { + SQL_QUERY($SQL, __FUNCTION__, __LINE__); + } // END - if //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - EXIT!'); }