X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=35af66dc4477c33836cfe9c47105bf21ee5b8b7e;hb=77669502ccc2779d32a842f6d523fb68169fadda;hp=db7fa084b3a6a2394fd907b56f365cf5bdfa156b;hpb=c248f2635adab08859daf9b8f1355cd334507343;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index db7fa084b3..35af66dc44 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -3313,24 +3313,24 @@ function getUsersTotalLockedReferrals ($userid, $level = NULL) { // Is the not level NULL? if (!is_null($level)) { // Then add referral level - $add = ' AND r.`level`=' . bigintval($level); + $add = ' AND `r`.`level`=' . bigintval($level); } // END - if // Check for all referrals $result = SQL_QUERY_ESC("SELECT - COUNT(d.`userid`) AS `cnt` + COUNT(`d`.`userid`) AS `cnt` FROM - `{?_MYSQL_PREFIX?}_user_data` AS d + `{?_MYSQL_PREFIX?}_user_data` AS `d` INNER JOIN - `{?_MYSQL_PREFIX?}_user_refs` AS r + `{?_MYSQL_PREFIX?}_user_refs` AS `r` ON - d.`userid`=r.`refid` + `d`.`userid`=`r`.`refid` WHERE - d.`status` != 'CONFIRMED' AND - r.`userid`=%s + `d`.`status` != 'CONFIRMED' AND + `r`.`userid`=%s " . $add . " ORDER BY - d.`userid` ASC + `d`.`userid` ASC LIMIT 1", array( $userid