Firstly I would not be running a query inside a loop. If you are doing this then there is a problem that you need to address.
This is an example of an unary query. It will return one result and is like the one you have inside your 'for' loop.
$name = SELECT 'name' FROM member WHERE id = '3';
This would return only one value. Say if I was member with id 3 then $name would have value 'abc123'.
A lot of the time however you need more than one result returned. In your case you need 50. The following query will not hold a single result. Instead it will hold a muliple results and you can access these through a loop.
$result = SELECT 'name' FROM member;
$result now is what is called a resource. It has all the values of name from the member table.
How do you access these results? Simple! Iterate through them.
while ($row = mysql_fetch_assoc($result)) {
echo $row['name'];
}
Obviosley instead of echo you can choose to store the value in a variable and do as you wish.
Use mysql to get the $result you need. There are really good ways to query to database to get the desired result set. Then simply iterate through them.