Google Maps question - loading with info from MySQL DB
Google Maps question - loading with info from MySQL DB
Author
Discussion

incubus

Original Poster:

8,896 posts

313 months

Thursday 30th August 2007
quotequote all
I've got a MySQL DB with latitudes and longitudes in. I've also got a PHP page that pulls that info from the DB.

What I want to do is extract lat and long from the database, then load an embedded google map, centered on this lat/long pair.

However, it seems that the map has to be loaded in the head of the document (in other words, before I can go to the DB and get the info I
need). How can I:

Load the page
Get the info from the MySQL DB via PHP
THEN load the map centered on this point.

I've tried taking load() from the <body> tag and putting it between script tags in the page but it's not having it.

It's probably very easy, just having a brain out moment...Thanks.

mystomachehurts

11,669 posts

281 months

Thursday 30th August 2007
quotequote all
Surely just move your PHP code that does the DB lookups to a point before you output your HEAD code, or am I missing something?