title: How do I create an html form with multiple checkboxes
body: <p>This is my code for creating an html form that reads from a database and will allow the user to check and uncheck boxes for each of the 640 items.  This is the form.php:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>// execute query 
  $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
  
  // see if any rows were returned 
  if (mysql_num_rows($result) &gt; 0) { 
      // yes 
      // print them one after another 
      echo "&lt;html&gt;&lt;body&gt;  &lt;table cellpadding=10 border=1&gt;"; 
      while($row = mysql_fetch_assoc($result)) { 
          echo "&lt;tr&gt;"; 
          echo "&lt;td&gt;".$row['stickerID']."&lt;/td&gt;"; 
          echo "&lt;td&gt;" .$row['stickerName']."&lt;/td&gt;"; 
          echo "&lt;td&gt;".$row['stickerSection']."&lt;/td&gt;"; 
          echo "&lt;td&gt;"?&gt;
                   &lt;form name="some form" action="editform.php" method="post"&gt;
                   &lt;input type="checkbox" name="&lt;?php echo $row['stickerID'] ?&gt;" value=" &lt;?php echo $row['stickerStatus'] ?&gt; "&gt;
                   &lt;?php "&lt;/td&gt;";
          echo "&lt;/tr&gt;"; 
      }
      echo "&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;";
      echo " " ?&gt;
                   &lt;input type="submit" name="editWish" value="Edit"&gt;
                   &lt;/form&gt;
                   &lt;?php " ";
  } else { 
      // no 
      // print status message 
      echo "No rows found!"; 
  } 
  </code></pre>
  
  <p>The user must then be able to click on submit and have those values updated in the mysql database.</p>
  
  <p>Right now when I click the submit button, it posts to edit form.php which has this:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  //echo results
  foreach($_POST['stickerID'] as $k=&gt;$v ){
  echo $k;
  echo $v;
  }
  
  ?&gt;
  </code></pre>
  
  <p>But I don't get anything echoed.  I was thinking the problem could be that Im actually creating a form for every row instead of 1 form with many rows/checkboxes.  But when I move the form code after the   and the  tag to the line where  line, I can't even load the form.php, it just loads blank.</p>
  
  <p>Where is my problem? :)  Thx</p>