title: How do I post my blobs into different rows on the same id?
body: <p>My table:</p>
  
  <p>CREATE TABLE IF NOT EXISTS <code>mytable</code> (<br />
    <code>id</code> int(11) NOT NULL AUTO_INCREMENT,<br />
    <code>img1</code> mediumblob NOT NULL,<br />
    <code>img2</code> mediumblob NOT NULL,<br />
    <code>ext1</code> varchar(8) NOT NULL,<br />
    <code>ext2</code> varchar(8) NOT NULL,<br />
    PRIMARY KEY (<code>id</code>)<br />
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;<br /></p>
  
  <p>I want to work it like…</p>
  
  <pre><code>INSERT INTO table
  SET img1='$img1', ext1='$ext1', img2='$img2', ext2='$ext2'
  WHERE id='$id'; 
  </code></pre>
  
  <p><strong>Here is the example</strong> (sorry, dont have rep. for direct image input.): <br />
  This is how it does <strong>right now</strong> ------> <a href="http://i.imgur.com/AkYCzLz.png" rel="nofollow">http://i.imgur.com/AkYCzLz.png</a> <br />
  This is how <strong>I want it to work like</strong> -> <a href="http://i.imgur.com/0FH4Iqq.png" rel="nofollow">http://i.imgur.com/0FH4Iqq.png</a></p>
  
  <p>But I can't get that working. So far I've saved both of them - but in different ID's. I think, if my id's are fixed, it's gonna post properly.  My '<strong>id</strong>' is <strong>primary key</strong>.
  That's my code:</p>
  
  <p>$table = "mytable";</p>
  
  <pre><code>if(isset($_FILES['image1'])){
    $id = mysql_real_escape_string(htmlspecialchars($_POST['id']));
    $errors=array();
    $file_name1= $_FILES['image1']['name'];
    $file_size=$_FILES['image1']['size'];
    $file_tmp1=$_FILES['image1']['tmp_name'];
    $file_type=$_FILES['image1']['type']; 
  
    // file type is ok?
    $file_ext1=strtolower(end(explode('.',$_FILES['image1']['name'])));
    $extensions = array("jpeg","jpg","png"); 
    if(in_array($file_ext1,$extensions )=== false){
     $errors[]="extension not allowed, please choose a JPEG or PNG file."; 
    }
  
    if($file_size &gt; 2097152){
    $errors[]='File size up to 2 MB';
    }
    if(empty($errors)==true){
      move_uploaded_file($file_tmp1,"uploads/".$file_name1);
      $q = mysql_query("INSERT INTO $table SET id='$id', ext1='$file_ext1', img1='$file_tmp1'");
    }else{
      print_r($errors);
    }
  }
  
  if(isset($_FILES['image2'])){
    $id = mysql_real_escape_string(htmlspecialchars($_POST['id']));
    $errors=array();
    $file_name2= $_FILES['image2']['name'];
    $file_size=$_FILES['image2']['size'];
    $file_tmp2=$_FILES['image2']['tmp_name'];
    $file_type=$_FILES['image2']['type']; 
  
    // file type is ok?
    $file_ext=strtolower(end(explode('.',$_FILES['image2']['name'])));
    $extensions = array("jpeg","jpg","png"); 
    if(in_array($file_ext,$extensions )=== false){
     $errors[]="extension not allowed, please choose a JPEG or PNG file."; 
    }
  
    if($file_size &gt; 2097152){
    $errors[]='File size up to 2 MB';
    }
    if(empty($errors)==true){
      move_uploaded_file($file_tmp2,"uploads/".$file_name2);
      $q = mysql_query("INSERT INTO $table SET id='$id', ext2='$file_ext', img2='$file_tmp2'");
    }else{
      print_r($errors);
    }
  }
  </code></pre>