title: 3 dynamic combobox use php and jquery
body: <p>Need help... </p>
  
  <p>How if I want to make 3 select options use jquery,</p>
  
  <ol>
  <li>Parent </li>
  <li>Child </li>
  <li>Grandchild</li>
  </ol>
  
  <p>Can anyone help? 
  I will appreciate your help... </p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;?php
      $parentQuery = $db-&gt;query("SELECT * FROM kategori WHERE parent = 0 ORDER BY nama_kategori");
      $kategori = ((isset($_POST['parent']) &amp;&amp; !empty($_POST['parent']))?sanitize($_POST['parent']):'');
  ?&gt;
  &lt;div class="form-group col-md-3"&gt;
      &lt;label for="parent"&gt;Kategori 1:&lt;/label&gt;
      &lt;select class="form-control" id="parent" name="parent"&gt;
          &lt;option value="" &lt;?php echo (($kategori =='')?'selected':''); ?&gt;&gt; Select&lt;/option&gt;
          &lt;?php while($p = mysqli_fetch_assoc($parentQuery)): ?&gt;
          &lt;option value="&lt;?php echo $p['id_kategori'];?&gt;" &lt;?php echo (($kategori == $p['id_kategori'])?'selected=':''); ?&gt;&gt;
              &lt;?php echo $p['nama_kategori'];?&gt;
          &lt;/option&gt;
          &lt;?php endwhile; ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="form-group col-md-3"&gt;
      &lt;label for="child"&gt;Kategori 2:&lt;/label&gt;
      &lt;select class="form-control" name="child" id="child"&gt;&lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="form-group col-md-3"&gt;
      &lt;label for="child"&gt;Kategori 3:&lt;/label&gt;
      &lt;select class="form-control" name="grandchild" id="grandchild"&gt;&lt;/select&gt;
  &lt;/div&gt;
  </code></pre>