If it's enforced in the database, then when you try to insert it the
second time, the database should throw an error. That error can then
be trapped by CF and dealt with accordingly. This method will have
alot less overhead then querying every table to intend to insert on.

-Adam

----- Original Message -----
From: Ewok <[EMAIL PROTECTED]>
Date: Thu, 19 Aug 2004 19:56:07 -0400
Subject: Re: stop insert when user presses refresh
To: CF-Talk <[EMAIL PROTECTED]>

well ofcourse its enforced in the database... but you gotta query it
to find out.. .and in this case... with cf

  ----- Original Message -----
  From: Adrocknaphobia
  To: CF-Talk
  Sent: Thursday, August 19, 2004 7:20 PM
  Subject: Re: stop insert when user presses refresh

  Enforce this in your database, not cf.

  -adam

  ----- Original Message -----
  From: Ewok <[EMAIL PROTECTED]>
  Date: Thu, 19 Aug 2004 18:23:32 -0400
  Subject: Re: stop insert when user presses refresh
  To: CF-Talk <[EMAIL PROTECTED]>

  Personally, I'd do both... ALWAYS make sure your not getting dupe
  entries... and cflocate to a different page once the query has ran its
  course.

  Cflocate keeps them from just hitting refresh

  THe query check will keep them from going BACK and hitting submit
  again (if the page doesnt expire)

    ----- Original Message -----
    From: joe velez
    To: CF-Talk
    Sent: Thursday, August 19, 2004 2:01 PM
    Subject: Re: stop insert when user presses refresh

    I would go with the checking to see if a record already exists with
  the same info .. you should only need to check 1 to a few columns for
  verification. If a record exists, just skip over the insert.

    joe

    >There a re a couple approaches depending upon how you handle the user
    >once the insert has been made.
    >
    >Use cflocation after the insert to send the user elsewhere. Or
    >
    >Param a session['processed'] variable at the top of the page, set it to
    >false.
    >Check the variable before inserting. If the variable is equal to false,
    >insert, then set the processed variable to "true".
    >
    >The problem however arises when do you clear that variable out!
    >
    >I like to use cflcoation instead.
    >
    >
    >
    >> How do you stop a database insert from occurring when a user
    >> presses refresh?
    >>
    >> I remember seeing posts regarding this but I can't seem to find
  them.________________________________________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to