title: Update sql data from form and checkboxes
body: <p>I have created a form that update the data in a sql column, so far all good.
  The problem I have is that I would like to choose what columns are going to be updated, with checkboxes.
  So I want to categorize two files as movies, I just check the checkbox and write movies in the form.</p>
  
  <p>But its not only that. Every column is already connected to a checkbox, but I use this checkbox with an delete query, so I can delete multiple rows. </p>
  
  <p>So my question is more like, how can I combine this two function with "one" checkbox.</p>
  
  <p>This is some of my code.</p>
  
  <p>This is my table with the sql outputs, and with the delete button</p>
  
  <pre><code>&lt;?php  
  $files = mysql_query("SELECT * FROM files WHERE `user_name` = '{$_SESSION['username']}' ORDER BY `file_time` DESC LIMIT $start, $per_page")
      or die(mysql_error()); 
      ?&gt;
  &lt;table id="table-3"&gt;
   &lt;thead&gt;
          &lt;tr&gt;
              &lt;th scope="col"&gt;Upload User&lt;/th&gt;
              &lt;th scope="col"&gt;Filename&lt;/th&gt;
              &lt;th scope="col"&gt;Upload date&lt;/th&gt;
               &lt;th scope="col"&gt;IP adress&lt;/th&gt;
               &lt;th scope="col"&gt;Category&lt;/th&gt;
              &lt;th scope="col"&gt;Delete&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
  &lt;?php
  while (($row = mysql_fetch_assoc( $files )) !==false)
  { 
  echo "&lt;tr&gt;"; 
  echo "&lt;td&gt;".$row['user_name'] . "&lt;/td&gt; ";
  ?&gt;
  &lt;td class="download"&gt; &lt;a href="download.php?file_id=&lt;?php echo $row ['file_id']; ?&gt;"&gt; &lt;?php echo $row['file_name']; ?&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;?php echo "&lt;td&gt;".$row['file_time'] . "&lt;/td&gt; "; ?&gt;
  &lt;?php echo "&lt;td&gt;".$row['file_ip'] . "&lt;/td&gt; "; ?&gt;
  &lt;?php echo "&lt;td&gt;".$row['category'] . "&lt;/td&gt; "; ?&gt;
  &lt;td&gt;
  
  &lt;form action="delete.php" method="post"&gt;
  &lt;input type="checkbox" name="done[]" id="&lt;?php echo $row['file_id'] ?&gt;" value="&lt;?php echo $row['file_id'] ?&gt;"&gt;
  
  &lt;/td&gt;
  
  &lt;?php 
  }
      echo "&lt;/tr&gt;";
      echo "&lt;/table&gt;"; 
   ?&gt;
  &lt;input type ="submit" value ="Delete"&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>This form is the one with the update function</p>
  
  <pre><code> &lt;form action="function.php" method="post"&gt;
  category: &lt;input type="text" name="category" /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and 
  function.php</p>
  
  <pre><code>include('core/inc/init.inc.php');
  
      if(isset($_POST['category'])){
      $category = $_POST['category'];
      mysql_query("UPDATE files SET category='$category'
      /*WHERE category='genom' */ ");
  
      header("Location: profile.php?uid=" . $_SESSION['uid']);
      }else{
      header("Location: profile.php?uid=" . $_SESSION['uid']);
      };
  </code></pre>
  
  <p>How can I combine these two functions?</p>