Why not just use CFDIRECTORY on each page request? This will ensure that you have the most up-to-date list of directories.
What is the point of adding these to the database which could quickly become outdated? If you still need to do this, I would query the database, then run CFDIRECTORY. Then, put it all together with a Query of Query. You should be able to find the differences between the two. M!ke -----Original Message----- From: Robert Orlini [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 01, 2004 2:42 PM To: CF-Talk Subject: CFDIRECTORY question 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 Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185871 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

