Mike ...

By UPDATE, I take it to mean that you are doing a series of INSERTS into a
DB, based on a form submission.

Here is one possible solution ... do you have a field in your form that is
going to be UNIQUE to each form submission?  Such as ... E-Mail address?

If so, you might do something like this ...

Run this query first:

SELECT Email
FROM myTable
WHERE email = '#trim(form.email)#'

Then run a conditional:

cfif myquery.recordcount
        <!--- there was a match so don't insert a new record and tell the
user --->
cfelse
        <!--- there was no match, so insert your new record --->

/cfif

H.

        

> -----Original Message-----
> From: Mike Miessen [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, January 03, 2003 7:34 AM
> To:   CF-Talk
> Subject:      newbie school of hard knocks
> 
> I have successfully created a form to update (append) to the database.
> Now that I have accomplished this fantastic feat of skill I find that I
> have several duplicate entries that resulted from my testing.  How can I
> check for and avoid duplicate entries.  Since I am new to both CF and
> SQL I don't know which component to refer to for this task.
>  
> I know you guys will point me in the right direction.
>  
> Thanks.
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Reply via email to