Technically, you wouldn't even need to do the $i=0 and $i++ thing...
This should work just fine:
while($rows = mysql_fetch_array($result, MYSQL_NUM)) {
printf("<p>Username: %s <br> Password: %s</p>", $rows[0], $rows[1]);
}
Or even, for that matter, why do the MYSQL_NUM argument... Why not just use the index names themselves?
while($rows = mysql_fetch_array($result)) {
echo "<p>Username: ".$rows['username']."<br /> Password: ".$rows['password']."</p><br /><br />";
}
(Just curious is all)