title: How to show the subcategories which belong to a category?
body: <p>This code is for both category and subcategory.In category i am showing the all the value in dropdown but for subcategory i want to show the exact subcategories which are belongs to a category .please help me  </p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label for="exampleInputEmail1"&gt;Category Name&lt;/label&gt;
      &lt;select name="type" id="type"&gt;
          &lt;option&gt;Select Category&lt;/option&gt;  
          &lt;?php 
              $res= mysql_query("select * from ".CATEGORY."  order by id asc");
              while($data=mysql_fetch_array($res))
              {
          ?&gt;
          &lt;option value="&lt;?php echo $data['id'];?&gt;"&gt;&lt;?php echo $data['cat_name'];?&gt;&lt;/option&gt;
          &lt;?php } ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label for="exampleInputEmail1"&gt;Subcategory Name&lt;/label&gt;
      &lt;select name="type1" id="type1"&gt;
          &lt;option&gt;Select Category&lt;/option&gt;
          &lt;?php $res= mysql_query("select * from ".SUBCATEGORY." order by id asc"); 
          while($data=mysql_fetch_array($res))
          {
          ?&gt;
          &lt;option value="&lt;?php echo $data['id'];?&gt;"&gt;&lt;?php echo $data['sub_name'];?&gt;&lt;/option&gt;
          &lt;?php } ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;                               
  </code></pre>