Hi,
each call to mysql_fetch_array fetches the next row in a record set. In your case you just select the field named "name" so each array returned by mysql_fetch_array just contains one column.
Your code tries to print n columns of the first record. A better solutions is:
<?
$query = "SELECT name FROM players WHERE x = ". $object[5]->x ." AND y = ". $object[5]->y;
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
echo $row[0].',';
// also possible: echo $row['name'].',';
}
?>
which allows you to use the column name (or column alias) instead of an index.
Regards,
Thomas