garry27 Posted November 23, 2006 Share Posted November 23, 2006 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? Quote Link to comment Share on other sites More sharing options...
btherl Posted November 23, 2006 Share Posted November 23, 2006 Check the capitalization on $distanceList inside the loop :) Quote Link to comment Share on other sites More sharing options...
garry27 Posted November 23, 2006 Author Share Posted November 23, 2006 WOOHOO! thanks for pointing that out. ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.