title: AJAX call to php database Google maps markers
body: <p>I am trying to make connection with my database</p>
  
  <pre><code>$.ajax({
          url: 'pictures.php', data: "", dataType: 'json', success: function (rows) {
              for (var i in rows) {
                  var row = rows[i];
  
                  var id = row[0];
                  var name = row[1];
                  var pic = row[2];
                  var lat = row[3];
                  var lon = row[4];
                  $(addMarker( id + name + pic + lat + lon));
              }
          }
      });
  </code></pre>
  
  <p>This is pictures.php:</p>
  
  <pre><code>&lt;?php
  
  $dbname = 'test'; //Name of the database
  $dbuser = 'root'; //Username for the db
  $dbpass = ''; //Password for the db
  $dbserver = 'localhost'; //Name of the mysql server
  
  $dbcnx = mysql_connect("$dbserver", "$dbuser", "$dbpass");
  mysql_select_db("$dbname") or die(mysql_error());
  
  
  $query = mysql_query("SELECT * FROM bezienswaardigheden");
  
  $data = array();
  while ( $row = mysql_fetch_row($query) )
  {
      $data[] = $row;
  }
  echo json_encode( $data );
  exit
  
  ?&gt;
  </code></pre>
  
  <p>This is the function addMarker:</p>
  
  <pre><code>function addMarker(lat, lng, info) {
      var pt = new google.maps.LatLng(lat, lng);
      bounds.extend(pt);
      var marker = new google.maps.Marker({
          position: pt,
          icon: icon,
          map: map
      });
      var popup = new google.maps.InfoWindow({
          content: info,
          maxWidth: 300
      });
      google.maps.event.addListener(marker, "click", function () {
          if (currentPopup != null) {
              currentPopup.close();
              currentPopup = null;
          }
          popup.open(map, marker);
          currentPopup = popup;
      });
      google.maps.event.addListener(popup, "closeclick", function () {
          map.panTo(center);
          currentPopup = null;
      });
  }
  </code></pre>
  
  <p>I cant see markers on google maps with this code. The maps works perfect, but I want markers for places I fill in the database :( AJAX don't make connect with pictures.php.</p>