title: insert main check box and sub check box into table
body: <p>i've problem with my code especially about check box. ok, this is my code:</p>
  
  <pre><code>$sql = "SELECT * FROM logistic_manager ORDER BY id_lm";
  $main = mysql_query($sql);
  
  while($r = mysql_fetch_array($main)) {
    echo " + &lt;input type='checkbox' name='cx[]' value='$r[id_lm]' /&gt;&lt;b&gt;$r[logistic_manager]&lt;/b&gt;&lt;br&gt;";
    $sql2 = "SELECT * FROM area, logistic_manager WHERE area.id_lm = logistic_manager.id_lm AND area.id_lm = $r[id_lm]";       
    $sub = mysql_query($sql2);
    $jml = mysql_num_rows($sub);
    if($jml &gt; 0) {
      while($w=mysql_fetch_array($sub)){
        echo "&amp;nbsp &amp;nbsp &amp;nbsp - &lt;input type='checkbox' name='cxsub[]' value='$w[id_area]' /&gt;$w[area] - $w[id_area]&lt;br&gt;";
      }
    } else { print "&lt;br&gt; &amp;nbsp &amp;nbsp &amp;nbsp - Subuser undefined&lt;br&gt;";}
    print "&lt;br&gt;";
  }
  </code></pre>
  
  <p>output on html:</p>
  
  <pre><code>+ Logistic Manager id-&gt; 1 (selected)
        - A -&gt;id: 5 (selected)
        - B -&gt;id: 9
        - C -&gt;id: 10 (selected)
  
  + Logistic Manager id-&gt; 2 (selected)
        - D -&gt;id: 6 (selected)
  
  + Logistic Manager id-&gt; 3 
        - E -&gt;id: 7
  
  + Logistic Manager id-&gt; 4
        - F -&gt;id: 8
  </code></pre>
  
  <p>sorry, should check box not list..</p>
  
  <p>the question is how do i insert the selected check box into table?
  i'm so happy if any one can help this.. thanks before :)</p>