title: change an image via php dropdown
body: <p>What I am trying to do is change the image when an item is selected from the drop down. This is part of a form so I cant have the value change. However the option value is the row id, that row would also contain the target for the image. But because the target 'file' is called outside the loop it isn't firing. </p>
  
  <p>I read I have to call it within the loop first but can't get it to work. Could you look at the code below and throw me a hint? </p>
  
  <p>Thanks</p>
  
  <pre><code>    &lt;?php
  
  include ("conned-db.php");
  
  $result = mysql_query("SELECT * FROM gallery") 
  or die(mysql_error());  
  
  echo "&lt;select id='gallery_id' name='gallery_id' style='width:200px;' &gt;";
  
  
  while($row = mysql_fetch_array( $result ))
  {
  echo '&lt;option value=' . $row['id'] . '&gt;';
  echo $row['gallery_name'];
  echo '&lt;/option/&gt;';
  }
  echo "&lt;/select&gt;";
  echo "&lt;/td&gt;";
  echo "&lt;td colspan='2' rowspan='2'&gt;";
  echo '&lt;img src=' .$row['file']. '/&gt;&lt;/td&gt;';
  
      ?&gt;
  </code></pre>