title: send ID to PHP script and return img src tag from DB filename
body: <p>I am trying to do something easy I am sure but I have looked and tested and I am not doing something right.
  I have a DB that stores the image file name, I need to get the file name based on the ID in the HTML , let me explain:</p>
  
  <pre><code> &lt;div class="slide"&gt;
                      &lt;div class="image-holder"&gt;
                         &lt;img src="img/asoft_table.jpg" alt="" /&gt; 
                      &lt;/div&gt;
                      &lt;div class="info"&gt;
  
                          &lt;p&gt;Morbi a tellus lorem, id scelerisque ligula. Maecenas vitae turpis et.&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="slide"&gt;
                      &lt;div class="image-holder"&gt;
                          &lt;img src="img/soft_table.jpg" alt="" /&gt;
                      &lt;/div&gt;
                      &lt;div class="info"&gt;
  
                          &lt;p&gt;Sed semper, lorem ac lobortis bibendum, magna neque varius augue, vel accumsan.&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="slide"&gt;
                      &lt;div class="image-holder"&gt;
                          &lt;img src="img/living_room2.jpg" alt="" /&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>in each instance of an img tag, I need to insert the filename from the DB. so, first image tag would be primary key 1, second primary key 2 and so forth.
  Here is the PHP script I am using to retrieve the filename, which works, but I am unsure how to send the ID of the image to the script and then return it properly.</p>
  
  <pre><code> &lt;?php
   $hote = 'localhost';
   $base = '*****';
   $user = '*****';
   $pass = '*****';
   $cnx = mysql_connect ($hote, $user, $pass) or die(mysql_error ());
   $ret = mysql_select_db ($base) or die (mysql_error ());
   $image_id = mysql_real_escape_string($_GET['ID']);
   $sql = "SELECT image FROM image_upload WHERE ID ='$image_id'";
   $result = mysql_query($sql);
   $image = mysql_result($result, 0);
  
   header('Content-Type: text/html');
   echo '&lt;img src="' . $image . '"/&gt;';
   exit;
  
  
   ?&gt;
  </code></pre>
  
  <p>any help would be appreciated, thanks a heap</p>