Hi,
I have 2 tables i am querying. The first table has 2 columns, one for folder ID and the other for Category ID.
I want to query that table to get a loop of all the folder ID's based on the category ID chosen.
Then i query the second table that holds the folder ID's and Folder Names.
I compare the first tables folder ID results to the second tables folder ID's
My problem is that where i close off my loop i end up with a drop down select box for every result. Its like the query works but the order of it or the closing curly bracket is wrong.
Please Help
<?php
$queryfolderCat = "SELECT * FROM FoldersCats WHERE cat_id=".$_GET['catid'];
$folderCatresult = mysql_query($queryfolderCat) or die(mysql_error());
while ($rowfolderCat = mysql_fetch_array($folderCatresult)) { // first loop
$folderIdeez = $rowfolderCat['folder_id'];
$queryfolder = "SELECT * FROM Folders WHERE folder_id=".$folderIdeez." ORDER BY folder_name DESC";
$folderresult = mysql_query($queryfolder) or die(mysql_error());
?>
<select id="folder" name="folder" >
<?php
while ($rowfolder = mysql_fetch_array($folderresult)) { // second loop
$folder = $rowfolder['folder_id'];
$foldername = $rowfolder['folder_name'];
?>
<option selected value="<?php echo $folder;?>" >
<?php echo $foldername;?>
</option>
<?php }} // both loops closed ?>
</select>