Re: ARRAY - straightforward question?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: ARRAY - straightforward question?

From: Jimbus <mrbiggles909@yahoo.com>
Date: Mon May 01 2006 - 05:01:51 CEST

> Thanks, my coordinates are currently split into "latitude" and "longitude"
> cols, although I will also be soon using the geospatial functionality in
> mysql. (Geomotry Point etc).
>
> So, should I be looking to do something like this ... ?
>
> while($row = mysql_fetch_assoc($result)) {
> $data[ $row['longitude'].$row['latitude'] ][] = $row['bizname'];
> }

That's how I'd do it... concatenating the lat and long. Someone else replied
with a 3D array solution, which might be better in terms of speed. Not sure
about that though.

Anyone have an analysis of which would be faster? A longer array key vs. a
3D array.
Received on Mon May 1 03:08:20 2006