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?
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 & Web Development.
rgbworld.com
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 & Web Development.
rgbworld.com