I am new to this and have been trying to solve this one problem in my
spare time.

1. I can get the map portion to work with a single piece of info or
loop completely in javascript and a fixed starting point.

2. I can have the several nested queries that produce statements with
data that looks correct (when I echo them)

3. but for the life of me, I cannot get it all to work together, using
my queried data to make a map.

I apologize in advance if this has been hashed out elsewhere

<script src="http://maps.google.com/maps?file=api&v=2&key=my key"
type="text/javascript"></script>

<div id="map" style="width: 800px; height: 600px"></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(32.2, -99.1), 7, G_NORMAL_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
        include('connectionfile.inc');

/// put it all here
        $dblink = mysql_connect('localhost', $dbuser, $dbpass);
        $dblinked = mysql_select_db('mydatabase', $dblink);

        $q12 = "SELECT * FROM week_info WHERE current_week=1";
        $r12 = mysql_query($q12);


        while($a12 = mysql_fetch_array($r12))
        {
                $key = $a12[week];
                $words_caps=$a12[weekwordscaps];
                $dates=$a12[dates];
        }


        $q2 = "SELECT team_a, team_b, game_location FROM schedule_games WHERE
game_week=$key ORDER BY game_location ASC";
        $r2 = mysql_query($q2);

        echo "<font face='Arial, Helvetica, sans-serif'><strong><font
size='3'>2008 WEEK ".$words_caps." MAPS OF GAMES<br>".$dates."</
strong></font><p>";

        while($a2 = mysql_fetch_array($r2))

        {
                $team_a = $a2[team_a];
                $team_b = $a2[team_b];
                $game_site = $a2[game_location];
                $site_search = mysql_real_escape_string($game_site);

                        $q3 = "SELECT * FROM sixman_teams WHERE 
team_name='$site_search'
and team_lat<>0";
                        $r3 = mysql_query($q3);
                        while($a3 = mysql_fetch_array($r3))

                        {
                                $game_lat = $a3[team_lat];
                                $game_long = $a3[team_long];
                                $game_name = $site_search;
                                echo "var point = new GLatLng(" . $game_lat . 
"," . $game_long .
");\n";
                                echo "var marker = createMarker(point, '" .
addslashes($game_name) . "');\n";
                                echo "map.addOverlay(marker);\n";
                                echo "\n";
                        }

mysql_close($link);
?>

//]]>
</script>









--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to