I cannot seem to figure this out.

I have a table called dirs. It has columns named: dirID, dirPath and 
parentDirID.

The parentDirID handles the hierarchy.

All I need to do is have a cfselect that lists all the dirPaths but defaults to 
the parentDirID of the selected dir.

Here is the code:

<cfquery name="getAll" datasource="pcap">

        SELECT dirID, dirPath
    FROM dirs
    WHERE status = '1'
    ORDER BY dirPath

</cfquery>

<cfquery name="getCurrent" datasource="pcap">

        SELECT parentDirID
    FROM dirs
    WHERE dirID = '#url.dirID#'

</cfquery>

<cfform>

<cfselect name="parentID" query="getAll" display="dirPath" value="dirID" 
selected="#getCurrent.parentDirID#"></cfselect>

</cfform>

I know I have done stuff like this before but I think it is getting confused 
(or I am getting confused) because it is in the same table.

Any help on this would be great.

Thanks. 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290562
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to