Strugling with while loops from mysql result

hi,
i have this code that suppose to return 1 -> 5 rows from mysql table.
when i run it, all i get is the first row from the result.
if i'm remarking the code and placeing this line i see all the results