Link to home
Start Free TrialLog in
Avatar of magicwizard
magicwizard

asked on

Double entries when inserting a new records...

Hi Guys,

I have problem with inserting new records.  The problem is weird I must say.  Sometimes I get a double entries, sometimes I dont.  This is making me crazy as I never know when its gonna come out double again.

First of all, I checked on my code, its not running twice (most of friend told me this!).  

Secondly, I tried to query my table before inserting a new record, if found a same record (with the same batch of data), then delete it (not working too!!)

Thirdly, I put a <cflock> in all my insert statements, and it doesnt seems to work too.

So my question is, can anyone tell me what's going on here and how can I solve this as it comes and go, comes and go, unpredictable!

Thanks!
Avatar of dash420
dash420
Flag of Canada image

There is one chance that u may click save button twice. That why may two same record got inserted. u can do one check before insert into table. just check already the record exist. means selects the count(1) form table where all the matching fields i.e. all form value.
 
ASKER CERTIFIED SOLUTION
Avatar of anandkp
anandkp
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Yog
Yog

are you using cftransaction at all ?
Avatar of magicwizard

ASKER

I found the problem was with the javascript.  But it still appear to be weird to me as I usually does submission using the javascript notation docuemnt.formName.submit() and it doesn't give me my current problem.

Anyway, I will accept this as the answer as it does solve my problem for the time being.

Thanks guys!!