The moment I remove the PHP part from the code and run the page, it loads the map. So error has to be within the PHP code. Meanwhile, I will try to host it on some free site. Also I have been looking at all the MySQL examples in code.google.com and otherwise. No luck.. :( Will also create a separate php file to store the connection details and use the 'require' statement to call this file.
Thanks Ricky On Nov 13, 2:04 pm, mapperzUK <[EMAIL PROTECTED]> wrote: > A live link please - easier to debug. (even if its a blank map). > > There should be no reason for postgres and apache ports affecting the > map. > > you should really call on another php script for your username and > password. > > like 'phpsqlajax_dbinfo.php' is > herehttp://code.google.com/support/bin/answer.py?answer=65622 > > don't worry it's MYSQL in that case. > > Link please as the guidelines > states..http://groups.google.com/group/Google-Maps-API/web/suggested-posting-... > > then we can help, helping you. > > Mapperzhttp://mapperz.blogspot.com/ > > On Nov 13, 5:27 am, Ricky <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > I searched the old threads in this group, and also googled for it, but > > was unable to come up with a very convincing result. > > > I have my data on a PostgreSQL database. Have PHP/Apache configured > > and running. > > > <html> > > <head> > > <title>Social Audit</title> > > <script src="http://maps.google.com/maps? > > file=api&v=1&key=ABQIAAAAeN_LhMOi4FsadGt6q2yJqRRi- > > exo-90g1z9p2Z9OroAhcfs0axTr-W4zx9cE4tcCyp6mf1TJ2QiIAA" type="text/ > > javascript"></script> > > </head> > > <body> > > <p><strong>Social Audit</strong></p> > > <div id="map" style="width: 100%; height: 100%"></div> > > > <script type="text/javascript"> > > //<![CDATA[ > > > var map = new GMap2(document.getElementById("map")); > > map.addControl(new GLargeMapControl()); > > map.addControl(new GMapTypeControl()); > > map.addControl(new GScaleControl()); > > map.setCenter(new GLatLng(17.025273, 78.013916), 7, G_HYBRID_MAP); > > > // Creates a marker whose info window displays the given number > > function createMarker(point, number) > > { > > var marker = new GMarker(point); > > // Show this markers index in the info window when it is clicked > > var html = number; > > GEvent.addListener(marker, "click", function() > > {marker.openInfoWindowHtml(html);}); > > return marker; > > > }; > > > <?php > > $link = pg_connect("host=localhost port=5432 dbname=places user=abc > > password=xyz") or die("Could not connect: " . pg_error()); > > pg_selectdb("places",$link) or die ("Can\'t use dbmapserver : " . > > pg_error()); > > > $result = pg_query($link,"SELECT * FROM villages"); > > if (!$result) > > { > > echo "no results ";} > > > while($row = pg_fetch_array($result)) > > { > > echo "var point = new GLatLng(" . $row['lat'] . "," . $row['long'] . > > ");\n"; > > echo "var marker = createMarker(point, '" . addslashes($row > > ['village_name']) . "');\n"; > > echo "map.addOverlay(marker);\n"; > > echo "\n";} > > > pg_close($link); > > ?> > > > //]]> > > </script> > > > </body> > > </html> > > > When I run, its giving an empty screen. Could it be because the port > > for the PostGreSQL is 5432 and in apache it as 8080?!! Could it also > > be to do with some mistake in the username/password field?!! > > > Thanks in advance > > Ricky --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
