CoreyR Posted March 7, 2007 Share Posted March 7, 2007 Ok, I just start off doing this but I'm thinking I'm doing it wrong. I have Phoogle on my site and it works great but one problem. I have multiple address in my database, how do I pass the address to a new window running phoogle.php? Link to comment https://forums.phpfreaks.com/topic/41559-solved-google-maps/ Share on other sites More sharing options...
CoreyR Posted March 7, 2007 Author Share Posted March 7, 2007 Ok, I understand what is wrong but do not know how to fix it. The problem is each time I click on my link which calls the google map, the code below only executes once which is giving me the same map each time. http://www.romerowebsites.com/demo/view_listings.php In my file googlemap.php which calls the phoogle.php I have the following code. require_once 'phoogle.php'; $map = new PhoogleMap(); $map->setAPIKey("ABQIAAAAqJ_s059owdpe4QSV2eYcTBRflJZNvbanLx8_ukfuFPPwSn-nfBSFT9n5fABqKjEtezsSSOMULbirUQ"); ?> <? $map->printGoogleJS(); ?> <? //customization options are here $map->zoomLevel = 2; //zoom in as far as we can $map->setWidth(350); //pixels $map->setHeight(350); //pixels $map->controlType = 'large'; //show large controls on the side $map->showType = false; //hide the map | sat | hybrid buttons // Connects to your Database mysql_connect("mysql", "coreysromero", "sierra69") or die(mysql_error()); mysql_select_db("Realestate_Demo") or die(mysql_error()); $data = mysql_query("SELECT * FROM data WHERE status='For Sale'") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { $address=$_POST['address']; $city=$_POST['city']; $state=$_POST['state']; //CUSTOM INFO WINDOW DATA $map->addAddress("$info[address],$info[city],$info[state]",$description); } $map->showMap(); ?> Link to comment https://forums.phpfreaks.com/topic/41559-solved-google-maps/#findComment-201428 Share on other sites More sharing options...
CoreyR Posted March 7, 2007 Author Share Posted March 7, 2007 I added an id in my SQL data base which I did not have. I then added a if statement to the googlemap.php within my while loop and passes the id to the mapping page and it works!! I learned a lot. Link to comment https://forums.phpfreaks.com/topic/41559-solved-google-maps/#findComment-201790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.