I have this cfdirectory code (see below) that I want to read a list of
directory names and then insert into a table.
However, this script will be running each time a user accesses drop-down list.
I want to list the current directories and any new directory names that have
been added.
At this point it will add the directory names numerous times along with any new
directories.
How can it just add new directories to the table using this cfdirectory script?
Thanks!
<cfdirectory
directory="#GetDirectoryFromPath(GetTemplatePath())#"
name="myDirectory">
<cfloop query="myDirectory">
<cfif type EQ "dir">
<CFQUERY name="get" datasource="marketing">
INSERT INTO directories (name)
VALUES ('#mydirectory.name#')
Where #mydirectory.name# != '#name#'
</CFQUERY>
</cfif>
</cfloop>
Robert O.
HWW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185864
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54