I have used a PHP/MySQL tutorial demo (http://www.map-server.com/
googlemaps/tutorial_api2.html), but I'm getting this error message:
PHP Warning: mysql_fetch_array(): 4 is not a valid MySQL result
resource in C:\Inetpub\wwwroot\dir\index9.php on line 41
I had to add the mysql_free_result because I was getting an error
message that said I needed it.
I'd like to provide a link, but this page resides on a development
server, and I don't have time to configure some remote free host like
Tripod for PHP, MySQL, IIS and a Google API key. It's taken me the
better part of two weeks just to get it working on my own pc.
Any idea what the problem might be?
The demo php code is:
<?php
$link = mysql_connect("localhost", "id", "pass") or die("Could
not
connect: " . mysql_error());
mysql_selectdb("tblMyTable",$link) or die ("Can\'t use
dbmapserver :
" . mysql_error());
$result = mysql_query("SELECT * FROM markers",$link);
mysql_free_result($result);
if (!$result)
{
echo "no results ";
}
while($row = mysql_fetch_array($result))
{
echo "var point = new GLatLng(" . $row['lat'] . "," .
$row['lng'] .
");\n";
echo "var marker = createMarker(point, '" . addslashes($row
['name']) . "');\n";
echo "map.addOverlay(marker);\n";
echo "\n";
}
mysql_close($link);
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---