// Add points to rallye account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_points`=`beg_points`+%s WHERE `userid`=%s LIMIT 1",
array($points, $userid), __FUNCTION__, __LINE__);
+
+ // We need to set $add here, two
+ $added = (!SQL_HASZEROAFFECTED());
} else {
// Add points to account
initReferalSystem();
}
// Subtract begged points from member account if the admin has selected one
- if (isValidUserId(getBegUserid())) {
+ if (($added === true) && (isValidUserId(getBegUserid()))) {
// Subtract from this account
- subtractPoints('beg_payout', getBegUserid(), $points);
+ $added = ($added && subtractPoints('beg_payout', getBegUserid(), $points));
} // END - if
// Return result