Here is the code:
Code: Select all
foreach($ult AS $un => $at)
{
//determine the amount of credits to reward upline users
$amount_creds = constant(strtoupper($at).'_DL_PC_'.implode('', array_keys($ul, $un))) / 100;
//update credits statistic for users
mysql_query("UPDATE `users` SET `credits`=`credits`+$amount_creds, `credits_today`=`credits_today`+$amount_creds, `credits_month`=`credits_month`+$amount_creds, `credits_alltime`=`credits_alltime`+$amount_creds WHERE `username` = '$un' LIMIT 1") or die(mysql_error());
}I don't think it is possible, at least with my knowledge, to combine this into one query?