Hello I posted a problem earlier about a problem I am having with php and dropdown menus. For some reason the subcategory menu works fine (the options are filled with the subcategories from the database) but the categories dropdown just displays one empty space where there should be several categories. I am not sure what to do about this, I am new to this php/mysql gig and would really appreciate some help. I have looked at all the spelling to make sure that the variables are not miss spelt and started new databases to test it out to see if it had something to do with the db itself with to results........would appreciate any help....thanks
<?php
/ Category Dropdown /
$db = mysql_connect("localhost","root");
mysql_select_db("test",$db);
echo "<select name=\"category\">
<option selected>select existing category.......</option>";
$results = mysql_query("SELECT * FROM general GROUP BY category",$db);
while ($myrow = mysql_fetch_array($results)) {
printf ("<option value=\"$myrow[category]\">$myrow[category]");}
echo "</select>";
/ end Category list /
echo "</td>
<td valign=\"top\" align=\"left\" width=\"250\">
<input type=\"text\" name=\"category\" size=\"30\">
</td></tr>
<td align=\"left\">SubCategory</td><td align=\"left\">Create New SubCategory</td></tr>
<tr><td width=\"250\" align=\"left\" valign=\"top\">";
/ Subcategory Dropdown /
echo "<select name=\"subcategory\">
<option selected>select existing sub-category..</option>";
$result = mysql_query("SELECT * FROM general GROUP BY subcategory",$db);
while ($myrow = mysql_fetch_array($result)) {
printf ("<option value=\"$myrow[subcategory]\">$myrow[subcategory]");}
echo "</select>";
?>