Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [pugdog] Need help with Sort by distance

Quote Reply
Re: [pugdog] Need help with Sort by distance In reply to
Yea, beyond me too <g>, so I didn't analyze it.

It worked perfectly when pasted into the sql query within phpMyAdmin.
I had to add the table prefix of lsql_ but otherwise it works fine.
I just wasn't able to rewrite it into GLinks.

I can come back to this as all it does is gets the orig set of zipcodes, and i don't think that putting them in order of distance is going to help at all with the final order of the results.

To grab the 1st array of zip codes within distance. I thought this might help. They are calling a function.

mysql> SELECT CONCAT(last_name,', ',first_name) AS full_name
-> FROM mytable ORDER BY full_name;

So can I do this?
Code:
my $zipcode_db = $DB->table('ZipCodes') || return $GT::SQL::error;
my $osth = $zipcode_db->select({ distance($olat, $olon, Latitude, Longitude, $unit) => '<' 50 })->fetchrow_hashref;

or maybe something like this 1/2 converted mess?
mysql> SELECT * FROM ZipCodes WHERE distance($olat, $olon, Latitude, Longitude, $unit) < 50

For the temporary table all I have is scraps so far...
# For an empty copy of a table use LIKE
CREATE TEMPORARY TABLE IF NOT EXISTS new_tbl LIKE orig_tbl;

This is going to take a while :-) So I better keep at it!

Chris
RGB World, Inc. - Software &amp; Web Development.
rgbworld.com
Subject Author Views Date
Thread Need help with Sort by distance rgbworld 13802 May 28, 2005, 7:04 AM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13687 May 28, 2005, 8:18 AM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13668 May 28, 2005, 11:57 AM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13673 May 28, 2005, 1:04 PM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13617 May 28, 2005, 4:36 PM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13614 May 29, 2005, 4:28 AM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13587 May 29, 2005, 11:24 AM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13562 May 29, 2005, 2:43 PM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13730 May 29, 2005, 4:38 PM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13593 May 30, 2005, 9:51 PM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13619 May 31, 2005, 12:33 AM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13597 May 31, 2005, 10:33 AM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13574 May 31, 2005, 12:17 PM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13544 May 31, 2005, 7:13 PM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13518 May 31, 2005, 9:28 PM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13597 May 31, 2005, 10:25 PM
Thread Post deleted by rgbworld
rgbworld 13550 May 31, 2005, 11:25 PM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13529 May 31, 2005, 11:32 PM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13532 Jun 1, 2005, 2:11 AM
Thread Re: [rgbworld] Need help with Sort by distance
rgbworld 13502 Jun 2, 2005, 12:38 AM
Thread Re: [rgbworld] Need help with Sort by distance
pugdog 13530 Jun 2, 2005, 10:23 AM
Thread Re: [pugdog] Need help with Sort by distance
rgbworld 13461 Jun 5, 2005, 1:45 AM
Post Re: [rgbworld] Need help with Sort by distance
Alba 13260 Apr 17, 2006, 4:31 AM