title: Loading an image through PHP
body: <p>I'm trying to load an image through PHP, but I don't know how.
  The filename is stored in the database, such as <code>image.jpg</code></p>
  
  <pre><code>if($_GET['image']){
      // Client requesting image, so retrieve it from DB
      $id = mysql_real_escape_string($_GET['image']);
      $sql = "SELECT * FROM $tbl_name WHERE id = '$id' LIMIT 1";
  }
  </code></pre>
  
  <p>The client needs to request an image like so</p>
  
  <pre><code>http://example.com/index.php?image=1
  </code></pre>
  
  <p>And then it should return the image, so it can be embedded like this:</p>
  
  <pre><code>&lt;img src="http://example.com/index.php?image=1" alt="" /&gt;
  </code></pre>
  
  <p>Is this possible?</p>