$id = $_COOKIE['user_id'];
$query = mysql_query("SELECT `username`, `cash`` FROM `users` WHERE `part` = $id ORDER BY `user_id` DESC");
while ($row = mysql_fetch_assoc($query)) {
if ($row["username"]) {
$bonus = ($row["cash"] * 7) / 100;
} else
$bonus = 0;
if ($id) {
mysql_query("UPDATE `user` SET `bal` = `bal` + $bonus WHERE `part` = $id");
}
echo '<br>';
}