title: echo base64 image from database php into infowindow google maps output
body: <p>I have a problem regarding my website project. I have stored strings of <strong>base64</strong> images in my online mySQL database, in which i have stored it according to corresponding arrays, along with other data. I want to show the picture in Google Maps InfoWindow. Unfortunately, only the image does not show in the InfoWindow when the marker in the Google Maps has been clicked. </p>
  
  <p>I have tried to input <strong>header('Content-Type: image/jpeg')</strong> inside the coding but it turns out to make the website into a black blank website. </p>
  
  <pre><code>var infoWindowContent = [
      &lt;?php 
      if($result2-&gt;num_rows &gt; 0){
          while($row = $result2-&gt;fetch_assoc()){ ?&gt;
              ['&lt;div class="info_content"&gt;' +
              '&lt;h3&gt;ID : &lt;?php echo $row['id']; ?&gt;&lt;/h3&gt;' +
              '&lt;p&gt; Latitude : &lt;?php echo $row['latitude']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Longitude : &lt;?php echo $row['longitude']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Type of distress: &lt;?php echo $row['typeofdistress']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Measurement : &lt;?php echo $row['measurement']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Depth : &lt;?php echo $row['depth']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Severity Level : &lt;?php echo $row['severitylevel']; ?&gt;&lt;/p&gt;'+
              '&lt;p&gt; Solution : &lt;?php echo $row['solution']; ?&gt;&lt;/p&gt;'+ 
              '&lt;p&gt; Image : &lt;/p&gt;'+'&lt;?php header('Content-Type: image/jpeg'); echo '&lt;img src="data:image/jpeg;base64,' .base64_encode($row['image']). '" /&gt;'; ?&gt;'+'&lt;/div&gt;'],
      &lt;?php }
      }
      ?&gt;
  ];
  </code></pre>
  
  <p>This below is my snippet of my InfoWindow
  <a href="https://i.stack.imgur.com/6aHqe.png" rel="nofollow noreferrer">Click here</a></p>