title: php editing entry with uploaded image
body: <p>just a basic one I can imagine, but to me I'm struggling :)</p>
  
  <p>I have created this testimonial script, works fine apart from when I go to update an entry. All the data is there, which has been submitted apart from the images that have been uploaded for the entry. </p>
  
  <p>I am using EzSql and Mysql. </p>
  
  <p>The part of the code which isn't working correctly:</p>
  
  <pre><code>&lt;? if($_GET['action'] != 'edit') { ?&gt;
      Add a new testimonial:  
  &lt;? }else{ ?&gt;
      Update testimonial: 
  &lt;?
          $sql = "SELECT * from testimonials where id=".$_GET['tid'];
          $testimonialsData = $dbEze-&gt;get_row($sql);
  
          $update_company = $testimonialsData-&gt;company;
          $update_company_url = $testimonialsData-&gt;company_url;
          $update_content = $testimonialsData-&gt;content;
          $update_contentby_name = $testimonialsData-&gt;contentby_name;
          $update_contentby_position = $testimonialsData-&gt;contentby_position;
          $update_contentby_rating = $testimonialsData-&gt;rating;
          $update_logo = $testimonialsData-&gt;logo;
          $update_image = $testimonialsData-&gt;image;
          $update_twitter = $testimonialsData-&gt;twitter;
  
      } ?&gt;
  
  &lt;form  enctype="multipart/form-data" action="testadmin?action=insert" method="post"&gt;
      &lt;p&gt;Company:
  &lt;input type="text" name="company" size="20" value="&lt;?=$update_company?&gt;" /&gt;
  
        Website: 
        &lt;input type="text" name="company_url" size="20" value="&lt;?=$update_company_url?&gt;" /&gt;
        &lt;br /&gt;
        &lt;br&gt;
        Name: 
        &lt;input type="text" name="contentby_name" size="20" value="&lt;?=$update_contentby_name?&gt;" /&gt;
         Job Title: 
         &lt;input type="text" name="contentby_position" size="20" value="&lt;?=$update_contentby_position?&gt;" /&gt;
        &lt;br /&gt;
        &lt;br&gt;
        Rating: &lt;input type="text" name="rating" size="20" value="&lt;?=$update_contentby_rating?&gt;" /&gt;
        Twitter ID: &lt;input type="text" name="twitter" size="20" value="&lt;?=$update_twitter?&gt;" /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
         &lt;br&gt;
        Testimonial: 
        &lt;textarea name="content" rows="4" cols="35"&gt;&lt;?=$update_content?&gt;
      &lt;/textarea&gt;
    &lt;/p&gt;
      &lt;p&gt;Company Logo:
  &lt;input name="logo" type="file" size="20" value="&lt;?=$update_logo?&gt;" /&gt; 
        &lt;br /&gt;
        Product Photo:
  &lt;input name="image" type="file" size="20" value="&lt;?=$update_logo?&gt;" /&gt;
    &lt;/p&gt;
      &lt;p&gt;
  
        &lt;? if($_GET['action'] == 'insert' || $_GET['action'] == 'delete') { ?&gt;
        &lt;input type="hidden" name="insert" value="1" /&gt;
        &lt;a onclick="jQuery(this).closest('form').submit()" class="btn add"&gt;Add &lt;span class="helper"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;? }
      if($_GET['action'] == 'edit') {  ?&gt;
        &lt;input type="hidden" name="update" value="&lt;?=$_GET['tid']?&gt;" /&gt;
        &lt;input type="submit" value="Update"/&gt; 
        &lt;input type="button" value="Cancel" onclick="window.location='testadmin?action=insert'" /&gt;
    &lt;/p&gt;  
      &lt;?  } ?&gt;
  &lt;/form&gt;
  
  &lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;&lt;?php $dbEze-&gt;debug(); ?&gt;
  
  
  &lt;table width="927" border="0" cellpadding="5" style="table-layout:fixed; width: 900px; word-wrap:break-word; border-spacing: 5px"&gt;
      &lt;tr&gt;
        &lt;td width="85" bgcolor="#CCCCCC"&gt;Company&lt;/td&gt;
        &lt;td width="73" bgcolor="#CCCCCC"&gt;Website&lt;/td&gt;
        &lt;td width="97" bgcolor="#CCCCCC"&gt;Testimonial&lt;/td&gt;
        &lt;td width="55" bgcolor="#CCCCCC"&gt;Name&lt;/td&gt;
        &lt;td width="76" bgcolor="#CCCCCC"&gt;Job Title&lt;/td&gt;
        &lt;td width="56" bgcolor="#CCCCCC"&gt;Rating&lt;/td&gt;
        &lt;td width="48" bgcolor="#CCCCCC"&gt;Logo&lt;/td&gt;
        &lt;td width="125" bgcolor="#CCCCCC"&gt;Product Photo&lt;/td&gt;
        &lt;td width="91" bgcolor="#CCCCCC"&gt;Twitter&lt;/td&gt;
        &lt;td width="99" bgcolor="#CCCCCC"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?
      $sql = "SELECT * from testimonials";
      $testimonialsData = $dbEze-&gt;get_results($sql);
      foreach ($testimonialsData as $testimonial){
  
      $logo_cutup = explode('/', $testimonial-&gt;logo);
      $logo_lastword = $logo_cutup[(count($logo_cutup))-1];
  
      $image_cutup = explode('/', $testimonial-&gt;image);
      $image_lastword = $image_cutup[(count($image_cutup))-1];
      ?&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;company?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;company_url?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;content?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;contentby_name?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;contentby_position?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;rating?&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="&lt;?=$testimonial-&gt;logo?&gt;"&gt;&lt;?=$logo_lastword?&gt;&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="&lt;?=$testimonial-&gt;image?&gt;"&gt;&lt;?=$image_lastword?&gt;&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;?=$testimonial-&gt;twitter?&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;a href="testadmin?action=edit&amp;tid=&lt;?=$testimonial-&gt;id?&gt;" class="btn edit"&gt;Update &lt;span class="helper"&gt;&lt;/span&gt;&lt;/a&gt;
            &lt;br&gt;
            &lt;a href="testadmin?action=delete&amp;tid=&lt;?=$testimonial-&gt;id?&gt;" class="btn delete" onClick="return confirm('Are you 100% totally certain that you want to DELETE this testimonial?')"&gt;Delete &lt;span class="helper"&gt;&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Any advice would be great!</p>