$userid creates a variable..and then everytime you were cycling through the results, you were replacing the previous entry you put into it.
by using $userids[], you are creating an array, with $array['userid'] being pushed onto the end of the array.
You might also wanna think about rewriting your code. instead of getting all the userids and putting them in an array, just check the database against that userid, like
Code:
if ($voted = $DB_site->query_first("SELECT * FROM prijsvraag WHERE userid=$bbuserid")) {
// Display already voted code
} else {
// Display not voted code
}
This saves you the time of cycling through all the userids and simply checks to see if there's an entry in the database already for their userid.
hope that helps
-john