ok ok, i completely missed this.
$result is your query, and you execute it there. So $result is executed by mysql. Then, you take $query and try to execute $result. That means yo'ure running mysql_query twice. What you need to do is change your code to the following:
$result = "INSERT INTO `members` (`username`, `password`, `bnet`, `race`, `rank`, `email`, `aol`, `msn`, `yahoo`, `icq`) VALUES ('$username', '$password', '$bnet', '$race', '$rank', '$email', '$aol', '$msn', '$yahoo', '$icq'";
$query = mysql_query("$result", $db) or die(mysql_error());
Notice how $result no longer has mysql_query() performed on it, but it's performed on it when $query is created?
Give this a try. This should solve your problem.
Cgraz