Let's say that $nouser contains only unwanted usernames...
One could try simplifying the query a bit:
$query = "SELECT username from $db_tablename WHERE username NOT IN (";
foreach($nouser as $no)
$query .= "'$no',";
//Oops, MySQL probably won't like that extra comma
$query = substr($query,0,-1);
$query .= ") ORDER BY RAND() LIMIT 1";
Produces something along the lines of "SELECT username from usertable WHERE username NOT IN ('spammer','moron','luser','idiot') ORDER BY RAND() LIMIT 1"
As a bonus, this will work for any number of unwanted users > 0.
If there are errors; use mysql_error() to find out what MySQL thinks the problem is:
$userrow = mysql_query($query) or die(mysql_error());
Note too that if no results are returned (i.e., all of the users were excluded!), that would probably make the mysql_fetch_row() call fail as well.