I'm looking for a way to add a google maps button to a customer contact form that pulls the customers address from MySQL
So basically I want to have a google maps button on the customer contact form that takes the address for that customer stored in MySQL and when the button is pressed it navigates to google maps and displays that customers address.
Try this https://gis.stackexchange.com/questions/52370/how-to-geocode-addresses-from-mysql-and-add-them-like-markers-to-the-google-map I don't think it is exactly what you want but it should get you going in the right direction.
Here is a scenario for you. First of all you must know that you will have to use javascript with google maps api. As Jason suggested you must use geocode. Geocode is a service of google maps, that gives you the ability to give the api an address, so it can return you something that you can use for the map, like latitude and longtitude. What you can do is use ajax to request from your server the address, then you use the api as I mentioned and after that is easy. If you don't want to just place a marker, just don't. When you have the location in a way that is useful to your map, you can do whatever you want. From what I understand, you want an infowindow with the address in it.
Some examples that might help you
How to add an infowindow to your marker
UPDATE
I believe that, if you take the first example and change it a little bit it will do the work. In the example it takes the address from the input. What you will do, is when the user presses the button, then you make an ajax post (or get) to your server and receive the address. When you receive the address you use geocode as the example where you add an infowindow to your marker displaying what you want.
Here's how I did it! The original question was exactly what I was trying to find out...for hours and hours! Everything I found is for a much more complex implementation.
I just wanted a button that would take the address returned from the database and give the end-user the option to go to Google Maps. Couldn't find the solution anywhere.
Assuming my database has returned values to these fields:
'$loaded_street'
'$loaded_city'
'$loaded_state'
'$loaded_zip'
<a href="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo $loaded_street?>, +<?php echo $loaded_city?>,+<?php echo $loaded_state?>,+<?php echo $loaded_zip?>" data-role="button" data-ajax="false">Go to Map</a>
I did a property search at Google Maps, hit their "Send" button, which launched my email client and included a link to that address.
I took the address out and added the php for each field on my form and it worked! I'm sure there's a cleaner approach, but I'm not a programmer so I was happy to get it to work since finding such a simple answer was so difficult.
No script, no map API, geocodes, longtitude and lat. Just a link with the right variables.