title: php/mySql-Display image with path from mysql
body: <p>I'm trying to display images I have stored in the folder /img. 
  My DB table stores info about the image path.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>    $id = $_GET['id'];
      $query = "SELECT image_path FROM news_image WHERE image_id = '$id'";
      $result = mysql_query($query) or die('Error, query failed');
      $row = mysql_fetch_assoc($result);
      $filePath = $row['image_path'];
  </code></pre>
  
  <p>I want to display images something like this:</p>
  
  <pre><code>$image = echo '&lt;img src="./' . $filePath . '" /&gt;';
  </code></pre>
  
  <p>How do I use the $id variable in the code above to get the correct image?</p>
  
  <p>Thank you</p>