If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Google Maps MySQL query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-27-09, 14:29
wesohaire wesohaire is offline
Registered User
 
Join Date: Aug 2009
Posts: 1
Google Maps MySQL query

I am using a Google map store locator as outlined here:
Creating a Store Locator with PHP, MySQL & Google Maps - Google Maps API - Google Code

I've entered all of the locations into mysql tables using a cms. I have everything working fine but I want to bring in one more field (from another table) and use it in my xml. Is there a way I can edit the my query below to include a field from another table? Entries in both tables are keyed to a column called "entry_id"

Code:
$query = sprintf("SELECT field_id_13, field_id_11, field_id_18, field_id_19, field_id_20, field_id_15, field_id_16, field_id_17, ( 3959 * acos( cos( radians('%s') ) * cos( radians( field_id_18 ) ) * cos( radians( field_id_19 ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( field_id_18 ) ) ) ) AS distance FROM exp_weblog_data HAVING distance < '%s' ORDER BY distance LIMIT 0 , 20",
  mysql_real_escape_string($center_lat),
  mysql_real_escape_string($center_lng),
  mysql_real_escape_string($center_lat),
  mysql_real_escape_string($radius));
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On