That's exactly what you're doing in this line:
while($row=mysql_fetch_array($result)){
That's why it's called "fetch_array".
If that's not your question (and using question marks are good for marking questions), then you'll need to give more information about what you're trying to do and what you're trying to achieve.
And I should warn you that [thread=10387467]you shouldn't be using the MySQL extension[/thread].