Jump to content

error when using array_multisort()


garry27

Recommended Posts

why am i getting the following error:

<b>Warning</b>:  array_multisort() [<a href='function.array-multisort'>function.array-multisort</a>]: Array sizes are inconsistent in <b>/home/unn_p921847/public_html/test4/map_data2.php</b> on line <b>77</b><br />
var points = {
p1:{lat:54.5234,lng:-1.55808},
p2:{lat:54.5236,lng:-1.55782},
p3:{lat:54.5239,lng:-1.55771},
p4:{lat:54.5246,lng:-1.55355},
p5:{lat:54.5254,lng:-1.55736}
}

when i run this code:

[code]
...

$list = $distanceList = array();
  $i = 0;
  $row = mysql_fetch_assoc($sql);
  while($row)
  {
    $i++;
extract($row);
$list[$i] = "p{$i}:{lat:{$lat},lng:{$lng}}";
$distancelist[$i] = surfaceDistance($lat,$lng,$knownLat,$knownLng,'km');
$row = mysql_fetch_assoc($sql);
    }

//sort array by distance
array_multisort($distanceList,$list);        // line77

...
[/code]

the outputted javascript data structure seems fine so what can be causing the warning?

Link to comment
https://forums.phpfreaks.com/topic/28187-error-when-using-array_multisort/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.