title: plupload filename to database problems
body: <p>I have troubles trying to save the file name of an uploaded file with Plupload. Here is the Plupload section:</p>
  
  <pre><code>echo&lt;&lt;&lt;_END
    &lt;div id="container"&gt;
      &lt;div id="filelist"&gt;No runtime found.&lt;/div&gt;
      &lt;br /&gt;
      &lt;a id="pickfiles" href="javascript:;"&gt;[Select file]&lt;/a&gt; 
      &lt;a id="uploadfiles" href="javascript:;"&gt;[Upload it]&lt;/a&gt;
    &lt;/div&gt;
  
    &lt;script type="text/javascript"&gt; 
    // Custom example logic
      function $(id) {
        return document.getElementById(id);
      }
  
    var uploader = new plupload.Uploader({
      runtimes : 'gears,html5,flash,silverlight,browserplus',browse_button : 'pickfiles',container: 'container',max_file_size : '1mb',
      url : 'upload.php',
      resize : {width : 320, height : 240, quality : 90},
      flash_swf_url : 'plupload/js/plupload.flash.swf',
      silverlight_xap_url : 'plupload/js/plupload.silverlight.xap',
      filters : [{title : "Image files", extensions : "jpg,jpeg,gif,png"}]
    });
  
    uploader.bind('Init', function(up, params) {
      $('filelist').innerHTML = "&lt;div&gt;Current runtime: " + params.runtime + "&lt;/div&gt;"; 
    });
  
    uploader.bind('FilesAdded', function(up, files) {
      for (var i in files) {
        $('filelist').innerHTML += '&lt;div id="' + files[i].id + '"&gt;' + files[i].name     + ' (' + plupload.formatSize(files[i].size) + ') &lt;b&gt;&lt;/b&gt;&lt;/div&gt;';
      }});
  
    uploader.bind('UploadProgress', function(up, file) {
      $(file.id).getElementsByTagName('b')[0].innerHTML = '&lt;span&gt;' + file.percent + "%    &lt;/span&gt;";
    });
  
    $('uploadfiles').onclick = function() {
      uploader.start();
      return false;
    };
  
    uploader.init();
  &lt;/script&gt;
  _END;
  </code></pre>
  
  <p>But I have no idea how to insert the file name into my database:</p>
  
  <pre><code>$post_img = file??
  
  $topicid = mysql_insert_id();
  $sql = "INSERT INTO
      posts(post_content,
      post_date,
      post_topic,
      post_by,
      post_img
    )
    VALUES
    (
      '" . mysql_real_escape_string($_POST['post_content']) . "',
      NOW(),
      " . $topicid . ",
      " . $_SESSION['userid'] . ",
      " . $post_img . " )";
    $result = mysql_query($sql);
  
    if(!$result) {
      //something went wrong, display the error
      echo 'An error occured while inserting your post. Please try again later.&lt;br /&gt;&lt;br /&gt;' . mysql_error();
      $sql = "ROLLBACK;";
      $result = mysql_query($sql);
    }
  </code></pre>
  
  <p>I am getting the error 'An error occured while inserting your post. Please try again later'</p>