title: php - cannot load image from database
body: <p>I'm trying to design a page in php which shows images from database. or I would say only the location of images are in database.</p>
  
  <p>But, when it shows up the images.. But it does print the image path.. That means it is getting the image path without any issue.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>&lt;?php
  
  $con = mysqli_connect("localhost", "root", "", "foodies");
  if(mysqli_connect_errno()){
      echo "Failed to connect to mysql";
      mysqli_connect_error();
  }
     $sql = "select img, name from products";
     $result = $con-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
      // output data of each row
      while($row = $result-&gt;fetch_assoc()) {
          $img = $row["img"];
          $name = $row["name"];
          //$srcc = "C:\wamp\www\foodies\images";
          //$quality=100;
          //echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "&lt;br&gt;";
          echo "&lt;img src='".$row['img']."' width=200 height=200/&gt;";
  
          ?&gt;
  </code></pre>