Jump to content

Output post code from MySQL, create Google Map with marker


ade234uk
Go to solution Solved by ade234uk,

Recommended Posts

I'm building a free events site, however I need some direction on the following as I am completely confused on how the process should work.

 

I can output all the results from MySQL via php, what I would like to do is use the information from the post_code field in my database to create a google map with a marker showing the location.

 

My preferred way would be to insert the post_code in to the url which the user clicks and takes them to google maps showing the marker on the map. From there the user can manipulate the map, zoom, get directions and all the other functions google maps offers.

 

I could just do it like this

<code><a href="http://maps.google.com/maps?q=<?php echo $row['post_code']; ?>">Click here for map</a></code>

but I feel this is the wrong way of going about it.

 

I already have a google API.

 

Hope this makes some sort of sense.

Edited by ade234uk
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.