title: blueimp jQuery File Upload PHP MySQL database integration third textfield
body: <p>I would like more than the two text fields 'title' and 'description' at upload, write to the DB. 
  The DB is extended to the field 'datum'. 
  The index.php - see below - file is expanded to include the new field. 
  But it is written no entry.
  Also the upload form has been extended by the field 'datum'.</p>
  
  <pre><code>protected function handle_form_data($file, $index) {
      $file-&gt;title = @$_REQUEST['title'][$index];
      $file-&gt;datum = @$_REQUEST['datum'][$index];
      $file-&gt;description = @$_REQUEST['description'][$index];
  }
  
  protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,
          $index = null, $content_range = null) {
      $file = parent::handle_file_upload(
          $uploaded_file, $name, $size, $type, $error, $index, $content_range
      );
      if (empty($file-&gt;error)) {
          $sql = 'INSERT INTO `'.$this-&gt;options['db_table']
              .'` (`name`, `size`, `type`, `title`, `datum`, `description`)'
              .' VALUES (?, ?, ?, ?, ?, ?)';
          $query = $this-&gt;db-&gt;prepare($sql);
          $query-&gt;bind_param(
              'sisss',
              $file-&gt;name,
              $file-&gt;size,
              $file-&gt;type,
              $file-&gt;title,
              $file-&gt;datum,
              $file-&gt;description
          );
          $query-&gt;execute();
          $file-&gt;id = $this-&gt;db-&gt;insert_id;
      }
      return $file;
  }
  
  protected function set_additional_file_properties($file) {
      parent::set_additional_file_properties($file);
      if ($_SERVER['REQUEST_METHOD'] === 'GET') {
          $sql = 'SELECT `id`, `type`, `title`, `datum`, `description` FROM `'
              .$this-&gt;options['db_table'].'` WHERE `name`=?';
          $query = $this-&gt;db-&gt;prepare($sql);
          $query-&gt;bind_param('s', $file-&gt;name);
          $query-&gt;execute();
          $query-&gt;bind_result(
              $id,
              $type,
              $title,
              $datum,
              $description
          );
          while ($query-&gt;fetch()) {
              $file-&gt;id = $id;
              $file-&gt;type = $type;
              $file-&gt;title = $title;
              $file-&gt;datum = $datum;
              $file-&gt;description = $description;
          }
      }
  }
  </code></pre>