title: Displaying multiple markers in google map
body: <p>I want to display multiple markers on my Google map and my latitude and longitude will be coming from the database. I have been trying for days but I can't seem to make it work. 
  Could anyone please help me? I would really appreciate it.</p>
  
  <p>This is my <strong>PHP</strong> code:</p>
  
  <pre><code>$result=mysql_query("SELECT latlong FROM terminal");
  while($row1 = mysql_fetch_array($result, MYSQL_NUM))
       $lat[] = $row1[0];
  
  $latlen = sizeof($lat);
  
  $result2=mysql_query("SELECT longitude FROM terminal");
  while($row2 = mysql_fetch_array($result2, MYSQL_NUM))
      $longi[] = $row2[0];
  
  
  for ($x=0;$x&lt;$latlen;$x++){
      $latitude = $lat[$x];
      $longitude = $longi[$x];
  }
  </code></pre>
  
  <p>But the problem is, I don't know how the loop will work on my <strong>JavaScript</strong> code:</p>
  
  <pre><code>var latitude = "&lt;?php print_r ($latitude); ?&gt;";
  var longitude = "&lt;?php print_r ($longitude); ?&gt;";
  
  var locations = [
      ['Bondi Beach', latitude,longitude ], 
  ];
  </code></pre>
  
  <p>This code only shows 1 marker. Please help.</p>