to debug what is going on, you can echo $i . "<br>"; or something so you see what the $i value is in different iterations inside the while loop, that way it will be easy to fix for you. the variable is probably only 1 off for it to work, the approach is OK
PHP Code:
while($users = mysql_fetch_array($users_query)){
echo $i . "<br>";
if($count > $i){
echo($users['username'].' - ');
$i++;
}
elseif($count == $i){
echo($users['username']);
}
}