Get Values of Dropdown based on First Dropdown selected
<p><strong>PHP/MYSQL</strong></p>

<pre><code>&lt;div style="width:810px; margin:inherit; padding-left:170px;"&gt;
    &lt;select style="width:300px;" id="n" name="userListingCateory"&gt;

        &lt;option  disabled="disabled"&gt;Category...&lt;/option&gt;
        &lt;?php while($row = $sth2-&gt;fetch(PDO::FETCH_ASSOC))
        {echo "&lt;option value=". $row['catID'] . "&gt;" .$row['catName']."&lt;/option&gt;";}
        unset($sth2);
        ?&gt;
    &lt;/select&gt; 
    &lt;select style="width:340px;" id="n" name="userListingSubCateory"&gt;
        &lt;option  disabled="disabled"&gt;Sub-Category...&lt;/option&gt;
        &lt;?php while($row = $sth3-&gt;fetch(PDO::FETCH_ASSOC))
        {echo "&lt;option value=". $row['scatID'] . "&gt;" .$row['scatName']."&lt;/option&gt;";}
        unset($sth3);
        ?&gt;
    &lt;/div&gt;
&lt;/select&gt; 
</code></pre>

<p>This HTML above gets all categories and sub-categories in two tables <code>[Category]</code> and <code>[SubCategory]</code></p>

<p>The php/mysql that needs to run upon clicking the <code>[Category]</code> dropdown would look like:</p>

<pre><code>SELECT scatID, scatName 
FROM Category C, SubCategory SC
WHERE C.catID = SC.catID
AND C.catID = $origCatIDSelected;
</code></pre>

<p>How do I get this to get the <code>sub-categories</code> based on which <code>category</code> is chosen?</p>

<p>Is there any easy way to implement in jquery/php?</p>

<p>Thanks</p>
