PHP: Category and Subcategory through echoing variables
<p>I am only able to echo the first selectbox but not the sub category. I checked the code for syntax errors and there were none found. I am guessing the logic is incorrect. Can anyone tell me  Why is it not displaying the subcategories select box ?</p>

<pre><code>   &lt;?php 

    $dbh = new PDO("mysql:host=" . $host . ";dbname=" . $db, $user, $pass);

    if(isset($_GET["category"]) &amp;&amp; is_numeric($_GET["category"]))
    {
        $category = $_GET["category"];
    }


    ?&gt;


    &lt;form name="theForm" method="get"&gt;

        &lt;!-- Category SELECTION --&gt;

   &lt;select name="category" size="6" onChange="autoSubmit();"&gt;
                &lt;?php
        $categories = $dbh-&gt;query('SELECT * FROM category ORDER BY c_id');

        while ($row = $categories-&gt;fetch()) {
        echo '&lt;option value="' . $row['c_id'] . '"';
        if ($row['c_id'] == $category) echo ' selected';
        echo '&gt;' . htmlentities($row['category']);
      }
                ?&gt;
   &lt;/select&gt;

        &lt;br&gt;&lt;br&gt;



    &lt;/form&gt;
</code></pre>
