title: multiple marker on googlemaps from php and mysql
body: <p>i try to make multiple markers on googlemaps and taking data from database. 
  this is my code</p>
  
  <pre><code>&lt;script&gt;
  &lt;?php 
  
  
  $query =  $db-&gt;query('SELECT * FROM tbl_kabkot WHERE 1=1 AND latitude !=0 AND longitude !=0');
    while($row = $query-&gt;fetch()){                            
  
                                 $nama_kabkot = $row[nama_kabkot];
                                 $longitude = $row[longitude];                              
                                 $latitude = $row[latitude]; 
  
  
   ?&gt;
        var markers = [
                        [&lt;?= $nama_kabkotv ?&gt;, &lt;?= $latitude ?&gt;, &lt;?= $longitude ?&gt;]
  ];
  &lt;?php } ?&gt;
  
  function initMap() {
      var latlng = new google.maps.LatLng(-33.92, 151.25);
      var myOptions = {
          zoom: 10,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP,
          mapTypeControl: false
      };
      var map = new google.maps.Map(document.getElementById("peta"),myOptions);
      var infowindow = new google.maps.InfoWindow(), marker, i;
      for (i = 0; i &lt; markers.length; i++) {  
          marker = new google.maps.Marker({
              position: new google.maps.LatLng(markers[i][1], markers[i][2]),
              map: map
          });
          google.maps.event.addListener(marker, 'click', (function(marker, i) {
              return function() {
                  infowindow.setContent(markers[i][0]);
                  infowindow.open(map, marker);
              }
          })(marker, i));
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But this code only shows one value from the database.
  how can i show a multiple markers with database?</p>