Passing Results from SQL to Google Maps API in CodeIgniter
Posted
by Jason Shultz
on Stack Overflow
See other posts from Stack Overflow
or by Jason Shultz
Published on 2010-05-25T01:18:50Z
Indexed on
2010/05/25
1:21 UTC
Read the original article
Hit count: 268
I'm hoping to use google maps on my site.
My addresses are stored in a db. I’m pulling up a page where the information is all dynamic. For example: mysite.com/site/business/5 (where 5 is the id of the business).
Let’s say I do a query like this:
function addressForMap($id) {
$this->db->select(‘b.id, b.busaddress, b.buscity, b.buszip’);
$this->db->from(‘business as b’);
$this->db->where(‘b.id, $id);
}
How can I output the info to the google maps api correctly so that it display’s the map appropriately?
The API interface takes the results like this: $marker['address'] = 'Crescent Park, Palo Alto';
© Stack Overflow or respective owner