Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate database entry when using Firefox but not IE

Status
Not open for further replies.

bigDaftie

Programmer
Feb 28, 2003
36
GB
Hi there,
I'm using Coldfusion 6 and fusebox 4.1. I get a duplicate entry into the database when using Firefox but not when I use Internet Explorer. It's exactly the same code of course!
Any ideas?
Thanks,
Bruce
 
Hmmm, thats is odd. Are you doing any kind of browser-sniffing before processing the code? Like, if user has IE run page1.cfm, and if user has FF run page2.cfm?

Can you post the code in question so we can help debug?

____________________________________
Just Imagine.
 
I know, it is wierd. I thought I was going mad yesterday!

This is the sql
Code:
<cfset sqlString = "
	INSERT INTO tds_core (SURNAME,
				PREFERRED_FORENAME,
				PRN2, 
				curstatus,
				disabil,
				profile_status
				) 
	VALUES ('#ff_SURNAME#', 
			'#ff_PREFERRED_FORENAME#',
			'#ff_PRN2#',
			'#ff_curstatus#',
			'#ff_disabil#',
			0);
">
<cfoutput>gets here</cfoutput>
<cfquery name="qry_addNESIStudent" datasource="#request.dsn#">
	#preserveSingleQuotes(sqlString)#
</cfquery>

Do you know fusebox? I thought maybe i was calling this query more than once from within the circuit but the 'gets here' is only printed out once.

If I query the database immediately after to get the last added row by doing

Code:
<cfset sqlgetPRN = "
	SELECT @@IDENTITY AS LASTPRN
">

<cfquery name="qry_getLastAddedPRN" datasource="#request.dsn#">
	#preserveSingleQuotes(sqlgetPRN)#
</cfquery>
<cfoutput query="qry_getLastAddedPRN">
	<cfoutput>#ff_PRN#</cfoutput>
</cfoutput>

I don't seem to get the last row but the first one of the duplicates!

However if i do the same thing, using IE it works fine.

Thanks for your help. Any ideas of what I could check would be cool as I've been racking my brains over this one for a while.
 
Oh and I'm not doing any browser sniffing. Just quite a simple query to get some details from one table (name etc.) and then add it to another table.
 
This is the page I call the circuit from which just calls the query to insert into the database, with the additional info we get from this form.

Code:
<cfoutput>
<h3>Adding student: #ff_SURNAME#, #ff_PREFERRED_FORENAME#: #ff_matricNumber#</h3>
</cfoutput>
<cfoutput>
<form action="#request.self#" name="addNESIStudentForm">
<input type="hidden" name="fuseaction" value="#xfa.addNESIStudent#" />
<input type="hidden" name="ff_SURNAME" value="#ff_SURNAME#" />
<input type="hidden" name="ff_PREFERRED_FORENAME" value="#ff_PREFERRED_FORENAME#" />
<input type="hidden" name="ff_PRN2" value="#ff_matricNumber#" />
</cfoutput>
<p> 
    <label for="disabil"><span>Please select the Disability from the drop-down list: </span></label>
    <select name="ff_disabil" id="disabil">
      <option>Select an item</option>
      <cfoutput query="qry_getUCASDisabil"> 
        <option value="#disability_code#">#disability_description#</option>
      </cfoutput> 
    </select>
  </p>
<cfset sqlString = "
	SELECT *
	FROM qss_curstatus_fltr_for_addstudent
">
<cfquery name="qry_getCurstatus" datasource="#request.dsn#">
	#preserveSingleQuotes(sqlString)#
</cfquery>

<p> 
    <label for="curstatus"><span>Please select the type of addition: </span></label>
    <select name="ff_curstatus" id="curstatus">
      <option>Select an item</option>
      <cfoutput query="qry_getCurstatus"> 
        <option value="#curstatus#">#curstatus_description#</option>
      </cfoutput> 
    </select>
  </p>
<input name="submit" type="submit" value="submit">
</form>
 
bigDaftie, I've never used fusebox before, but I don't imagine the process to be anymore different then regular cf code.

What does the fusebox code look like?

____________________________________
Just Imagine.
 
I have had this happend on a simple single script...but it was with a version of EI.

there was a image with a bad src, and the browser would load the page twice. as soon as the image src was correct, the page loaded once. weird? yes.




Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
imstillatwork, are you saying that if the browser can't load the image (due to a bad SRC code or whatever) it will reload the page on its own? Never had that happen to me.

I did once have an issue where one record was being populated twice, after a pain-staking debugging I found that someone had copied the INSERT INTO clause somewhere else in a different page. I took a shot in the dark, and did a sitw wide search command on the table name and that's how I tracked it down.

bigDaftie, if you're using Dreamweaver as your WYSIWYG client then do a site wide search for the table name and see if you're calling it more then once. Be very careful that you click the 'search all' button and not 'replace all'.

____________________________________
Just Imagine.
 
GUJUm0deL

yes, I had an incrementing update query (field=field+1) and it would count 2 hits per page load when the image src was BLANK (src="") if there was anything in img src (src="anythingatall") it would not happen. I was not testing on firefox back then (2003 sometime) Ansd i don't know if it was only a particular version of IE that did it.

I was able to recreate it with a single script, no application.cfm, etc.. and it would do it every time the img src="" the counter on screen looked like it was counting by twos, but the database had all the entries in there, the page was getting hit twice.

Very odd. I have not tried it on other browsers since then.


Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
imstillatwork, wow thats interesting. Do you suppose that happened on the older FF versions, but the new versions it wouldn't happen?

____________________________________
Just Imagine.
 
No idea. I actually had a post on here about it from 2003 when it happened - i would expect it to be a per browser issue? I could never tell that the page reloaded by looking though.

While this issue might not be what happened to me, I have seen some weirdness as far as incrementing counters not behaving.

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Hi there,
Thank you so much for all your replies but especially to imstillatwork as this was the problem....

<style>
@import url("");
</style>

I was going to include another style sheet but never got round to it. Once I had taken this out the problem was solved. Wierd.
Thanks again cos this was really doing my head in and I would never have found this.
Bruce
 
Wow, i'm just surprised. I had no idea FF would reload the page again if there is a missing URL. I guess I should now code check for that as well.

Just out of curiousity bigDaftie what version of FF are you using?

____________________________________
Just Imagine.
 
Whats odd, is that I am 100% sure I was using IE when I had the similar issue.

Someone have time to do a few simple tests to support this oddity??

Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
I'm using 1.5.0.4 for Firefox.
Thanks again,
Bruce
 
We have been struggling with duplicate threads from a ColdFusion 7.0 application. We can demonstrate duplicates are created when IE 6.0 sp1 is used as the browser for a page but do not get duplicates when Netscape Navigator 7.02 is browser. We have can create the duplicates outside of a large application by creating a simple handler to write records either to MS-SQL or just a text file from an HTM page. We have experimented with both Apache and IIS and the duplicates seem to be consistent when IE is used. We have tried FireFox and it appears to create duplicates, but can get a definitive test, because our testing software (QuickTestPro) does not support Firefox.

Any suggestion on how to control or eliminate the duplicate threads would be most appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top