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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.