title: Retrieve data from a certain column and i can change the image whenever the data is different
body: <p>Is it possible to retrieve data from a certain column and have a if else statement to it where i can change the image?
  So basically i want to the pic to tally with the location that i retrieve with the database.</p>
  
  <pre><code>&lt;?php
  
  $servername = "......byethost5.com";
  $username = "....";
  $password = "...";
  $dbname = "b...";
  
  // 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 Location,DateTime FROM SensorDetails LIMIT 1";
  $result = $conn-&gt;query($sql);
  
  if ($result-&gt;num_rows &gt; 0) {
      // output data of each row
      while($row = $result-&gt;fetch_assoc()) {
          echo "Last Seen Location: " . $row["Location"]."&lt;br&gt;";
                   $Help= $row["Location"];
              if($Help=='Toilet')
               {echo '&lt;center&gt;&lt;img src="Toilet.jpg"&gt;&lt;/center&gt;';}
              elseif($Help=='Kitchen')
                {echo '&lt;center&gt;&lt;img src="Kitchen.jpg&lt;/center&gt;';}
              else {echo '&lt;center&gt;&lt;img src="BedRoom.jpg"&gt;&lt;/center&gt;';}
  
  
      }
  } else {
      echo "0 results";
  }
  
  $conn-&gt;close();
  ?&gt; 
  </code></pre>