从json_encode读取数据

Im having trouble with reading data from json_encode.

i want to read my users info (user_name, x_c0rd, y_cord)

My ajax:

$.ajax({
  url: 'inc/odczyt_multi.php',
  data: "",
  dataType: 'json',
  success: function (data) {
    if (data == 0) {
      //There r no users
    }
    else {
      for (var id in data) {
        var name = data[id][2];
        var multi_x = data[id][8];
        var multi_y = data[id][9];
        alert(name + multi_x + multi_y);
      }

This is my odczyt_multi.php

$result = mysql_query('SELECT * FROM `users` ORDER BY `id`') or die(mysql_error());
$rows = array();
while ($row = mysql_fetch_assoc($result)) {
  $rows[] = $row;
}
echo json_encode($rows);

And here is a result from odczyt_multi.php

[ { "cords" : "",
    "data" : "07.04.13",
    "email" : "ziaja@asdad.pl",
    "id" : "2",
    "kod" : "941140747",
    "pass" : "098f6bcd4621d373cade4e832627b4f6",
    "pozycja_x" : "9",
    "pozycja_y" : "6",
    "punkty_ruchu" : "1720",
    "skin" : "",
    "user" : "Ziaja"
  } ]

So there is 1 user in database.

How I can parse that data? Why my alert shout Nan instead of data of this user?

You should look into JSON Website for more information about reading the data.

If you were planning on having a bunch of info returned in json format. You could for loop through them.

for(var i=0;i<data.length;i++){

  Do stuff with data....

  data[i]['user'] //would return Ziaja
  data[i]['pass'] //would return 098f6bcd4621d373cade4e832627b4f6

}

I hope that is what you're talking about