title: Only the first entry from database is displayed
body: <p>I have 2 php files that retrieve a BLOB image from mysql DB. My DB has stored a couple of different images, as i try to display them on the browser, only the first image is displayed multiple times, for example: The DB table has stored 5 images, the browser is going to display the first image 5 times. 
  here is a snippet from my main php file:</p>
  
  <pre><code>$strSQL = "SELECT * FROM images";
  $rs = mysql_query($strSQL) or die (mysql_error());
  echo "&lt;table&gt;";
  while($row = mysql_fetch_array($rs)) {
  
  echo "&lt;tr&gt;&lt;td&gt;";
  echo " &lt;img src=load_pic.php?id=".$row["id"]." id='img' width='100' height='100'&gt;&lt;/a&gt;";
  echo "&lt;/td&gt;&lt;/tr&gt;";
  }
  
  echo "&lt;/table&gt;"
  </code></pre>
  
  <p>and the php file that gets the images "load_pic.php"</p>
  
  <pre><code> $q="select * from images";
     $rec=mysql_fetch_array(mysql_query($q));
     $data=$rec['image'];
     header('Content-Length: '.strlen($data));
    header("Content-type: image/".$rec['type']);
    echo $data;
  </code></pre>