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? Link to comment https://forums.phpfreaks.com/topic/28187-error-when-using-array_multisort/ 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 :) Link to comment https://forums.phpfreaks.com/topic/28187-error-when-using-array_multisort/#findComment-128936 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 Link to comment https://forums.phpfreaks.com/topic/28187-error-when-using-array_multisort/#findComment-128942 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.