title: Leaflet Show all Markers from Database to Map
body: <p>First I want to Demonstrate my code before asking my Question.</p>
  
  <p>The code below will show all of my data from Database to my Webpage</p>
  
  <pre><code>&lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname = "dbmarker";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
       die("Connection failed: " . $conn-&gt;connect_error);
  } 
  
  $sql = "SELECT * from tblmarker";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
       // output data of each row
       while($row = $result-&gt;fetch_assoc()) {
           echo  "&lt;br&gt;",$row["lat"],"     &amp;nbsp     &amp;nbsp    &amp;nbsp    &amp;nbsp    &amp;nbsp      ",$row["lng"] ;
       }
  } else {
       echo "0 results";
  }
  
  $conn-&gt;close();
  ?&gt;  
  </code></pre>
  
  <p>and this is the output of my code that will show all of the Lat/Long</p>
  
  <pre><code>14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  14.704659335030026           121.02397441864012
  </code></pre>
  
  <p>My question is how can i connect this output in this code?</p>
  
  <pre><code>var note = document.getElementById('note');
  var datepick = document.getElementById('demo1');
  var timepick = document.getElementById('timepick');
          layerpoly.on('click', function(e){
          var markerA = new L.Marker(e.latlng,{icon: Icon1});
          markerA.bindPopup("&lt;/a&gt;&lt;br&gt;&lt;strong&gt;FIRE&lt;/strong&gt;&lt;/br&gt;&lt;strong&gt;Date:&lt;/strong&gt;"+datepick.value+"&lt;/br&gt;&lt;strong&gt;Time:&lt;/strong&gt;"+timepick.value+"&lt;/br&gt;&lt;strong&gt;Address:&lt;/strong&gt;"+note.value+"&lt;strong&gt;&lt;br&gt;&lt;strong&gt;Suspect Sketch&lt;/strong&gt;&lt;br&gt;&lt;a href=legends/suspect.jpg rel=lightbox&gt;&lt;img src = legends/suspect.jpg height=100 width = 100/&gt;").addTo(map);
          closure1 (markerA)
  </code></pre>
  
  <p>Or to simplify my Question, How can i Fetch those outputs and convert them as Leaflet Lat/long of my marker? What will happen is that get the lat/long and put a marker on the map when the webpage finish load. TY</p>