I know when the data you need is in the same row, you can do this:
while($row=mysql_fetch_array($result)){
$id=$row[0];
$name=$row[1];
$commander=$row[2];
$objective=$row[3];
$maps=$row[4];
}
But what about when it's not in the same row, but in the same field where there isn't a set number?
Here's a screenshot from phpadmin:

I need to get all of the names who are signed up for a single operation.
This is the code I'm using:
//Pull out registered users from database
$query = "SELECT * FROM phpbb_operations_users WHERE operation_id = $op_id";
$result = $db->sql_query($query) or die(print_r($db->sql_error(),true));
while($row=mysql_fetch_array($result)){
$registered=$row[2];
}
This of course only pulls out one name.
I'm guessing I'll need a different kind of loop and an array, but i'm not sure how to go about doing it.