I have this function takes a long time to complete. Is there a way i can improve it to quicken the procedurefunction do_updatebonus() {    global $site_config;    $res200 = SQL_Query_exec(SELECT DISTINCT userid FROM peers WHERE seeder = 'yes');    while ($row200 = mysql_fetch_assoc($res200)) {        $userid = $row200[userid];        $res201 = SQL_Query_exec(SELECT COUNT(torrent) FROM peers WHERE seeder = 'yes' AND userid = $userid);        $c = mysql_result($res201, 0);        if ($c >= 5) {            SQL_Query_exec(UPDATE users SET seedbonus = seedbonus + ' . $site_config[bonuspertime] . ' WHERE id = $userid);        }    }}
can this php function be written to perform better?
php